Skip to content
Browse files

Revise to tolerate recent libcdio incompatibilities (those after vers…

…ion 0.83).
  • Loading branch information...
1 parent 389ed6d commit 871f6c3985a8f6cde73dfc089fac8c8e33cfce38 R. Bernstein committed Mar 10, 2012
Showing with 8 additions and 14 deletions.
  1. +2 −5 swig/device.swg
  2. +1 −7 swig/device_const.swg
  3. +5 −2 swig/disc.swg
View
7 swig/device.swg
@@ -1,5 +1,5 @@
/* -*- c -*-
- Copyright (C) 2006, 2008, 2011 Rocky Bernstein <rocky@cpan.org>
+ Copyright (C) 2006, 2008, 2011, 2012 Rocky Bernstein <rocky@cpan.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -343,14 +343,11 @@ driver_return_code_t cdio_get_last_session (CdIo_t *p_cdio,
%feature("autodoc",
"have_driver(driver_id) -> int
-Return 1 if we have driver driver_id, 0 if not and -1
-if driver id is out of range.");
+Return 1 if we have driver driver_id, 0 if not.");
%inline %{
int
have_driver (unsigned int driver_id)
{
- if (driver_id < CDIO_MIN_DRIVER || driver_id > CDIO_MAX_DRIVER)
- return -1;
if (cdio_have_driver(driver_id)) return 1;
return 0;
}
View
8 swig/device_const.swg
@@ -1,5 +1,5 @@
/* -*- c -*-
- Copyright (C) 2006, 2008, 2011 Rocky Bernstein <rocky@cpan.org>
+ Copyright (C) 2006, 2008, 2011, 2012 Rocky Bernstein <rocky@cpan.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -93,12 +93,6 @@
%constant long int DRIVER_NRG = DRIVER_NRG;
%constant long int DRIVER_DEVICE = DRIVER_DEVICE;
-%constant long int MIN_DRIVER = CDIO_MIN_DRIVER;
-%constant long int MIN_DEVICE_DRIVER = CDIO_MIN_DEVICE_DRIVER;
-%constant long int MAX_DRIVER = CDIO_MAX_DRIVER;
-%constant long int MAX_DEVICE_DRIVER = CDIO_MAX_DEVICE_DRIVER;
-
-
%constant long int DRIVER_OP_SUCCESS = DRIVER_OP_SUCCESS;
%constant long int DRIVER_OP_ERROR = DRIVER_OP_ERROR;
%constant long int DRIVER_OP_UNSUPPORTED = DRIVER_OP_UNSUPPORTED;
View
7 swig/disc.swg
@@ -1,5 +1,5 @@
/* -*- c -*-
- Copyright (C) 2006, 2008, 2011 Rocky Bernstein <rocky@cpan.org>
+ Copyright (C) 2006, 2008, 2011, 2012 Rocky Bernstein <rocky@cpan.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -92,11 +92,11 @@ get_disc_mode (CdIo_t *p_cdio)
}
%}
-
SV * get_cdtext (CdIo_t *p_cdio, int track);
%inline %{
SV * get_cdtext (CdIo_t *p_cdio, int track)
{
+#if LIBCDIO_VERSION_NUM <= 83
HV * cdtext_hash;
char **cdtext; const char *str; int num; unsigned int l=0;
cdtext = ( char **)cdio_get_cdtext (p_cdio, (track_t) track);
@@ -116,6 +116,9 @@ SV * get_cdtext (CdIo_t *p_cdio, int track)
return newSV(0);
} // we could easily return the number of strings, too.
return newRV_noinc(sv_2mortal((SV*)cdtext_hash));
+#else
+ return newSV(0);
+#endif
}
%}

0 comments on commit 871f6c3

Please sign in to comment.
Something went wrong with that request. Please try again.