diff --git a/include/cdio/device.h b/include/cdio/device.h index 59e0b9b8..4719d836 100644 --- a/include/cdio/device.h +++ b/include/cdio/device.h @@ -1,6 +1,6 @@ /* -*- c -*- - Copyright (C) 2005, 2006, 2008, 2009, 2010, 2011 Rocky Bernstein + Copyright (C) 2005, 2006, 2008, 2009, 2010, 2011, 2012 Rocky Bernstein This program is free software: you can redistribute it and/or modify @@ -200,10 +200,10 @@ extern "C" { enumeration in driver_id_t. Since we have a bogus (but useful) 0th entry above we don't have to add one. */ -static const driver_id_t CDIO_MIN_DRIVER __attribute__ ((deprecated("please use cdio_drivers"))) = DRIVER_AIX; -static const driver_id_t CDIO_MIN_DEVICE_DRIVER __attribute__ ((deprecated("please use cdio_device_drivers"))) = DRIVER_AIX; -static const driver_id_t CDIO_MAX_DRIVER __attribute__ ((deprecated("please use cdio_drivers"))) = DRIVER_NRG; -static const driver_id_t CDIO_MAX_DEVICE_DRIVER __attribute__ ((deprecated("please use cdio_device_drivers"))) = DRIVER_WIN32; +LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MIN_DRIVER, "please use cdio_drivers") = DRIVER_AIX; +LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MIN_DEVICE_DRIVER, "please use cdio_device_drivers") = DRIVER_AIX; +LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DRIVER, "please use cdio_drivers") = DRIVER_NRG; +LIBCDIO_DEPRECATED(static const driver_id_t CDIO_MAX_DEVICE_DRIVER, "please use cdio_device_drivers") = DRIVER_WIN32; /** The following are status codes for completion of a given cdio diff --git a/include/cdio/types.h b/include/cdio/types.h index 4fca860c..9385b2c6 100644 --- a/include/cdio/types.h +++ b/include/cdio/types.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008 + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008, 2012 Rocky Bernstein Copyright (C) 2000 Herbert Valerio Riedel @@ -158,8 +158,8 @@ typedef uint8_t ubyte; # define PRAGMA_END_PACKED #endif - /* - * user directed static branch prediction gcc 2.96+ + /** + * user-directed static branch prediction gcc 2.96+ */ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 95) # define GNUC_LIKELY(x) __builtin_expect((x),true) @@ -172,8 +172,22 @@ typedef uint8_t ubyte; #ifndef NULL # define NULL ((void*) 0) #endif - - /* our own offsetof()-like macro */ + + /** Provide a notice for deprecated elements. Before gcc 4.5 'deprecated' + takes no arguments. */ +#if defined(__GNUC__) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5) +# define LIBCDIO_DEPRECATED(object, notice) object __attribute__ ((deprecated(notice))) +# else +# define LIBCDIO_DEPRECATED(object, notice) object __attribute__ ((deprecated)) +# endif +#elif defined(_MSC_VER) +#define LIBCDIO_DEPRECATED(object, notice) __declspec(deprecated(notice)) object +#else +#define LIBCDIO_DEPRECATED(object, notice) +#endif + + /** our own offsetof()-like macro */ #define __cd_offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) /*!