types.h: gcc before 4.5 has a no-argument form of deprecated.

device.h: use LIBCIO_DEPRECATED macro rather than assume gcc.
This commit is contained in:
R. Bernstein
2012-02-24 05:10:24 -05:00
parent 998567ef2d
commit 1a7366c674
2 changed files with 24 additions and 10 deletions

View File

@@ -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
<rocky@gnu.org>
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

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008, 2012
Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
@@ -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)
/*!