Bayeux  3.4.1
Core Foundation library for SuperNEMO
api.h
Go to the documentation of this file.
1 //
12 // Copyright (c) 2013 by Ben Morgan <bmorgan.warwick@gmail.com>
13 // Copyright (c) 2013 by The University of Warwick
14 //
15 // This file is part of datatools.
16 //
17 // datatools is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 // datatools is distributed in the hope that it will be useful,
23 // but WITHOUT ANY WARRANTY; without even the implied warranty of
24 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 // GNU General Public License for more details.
26 //
27 // You should have received a copy of the GNU General Public License
28 // along with datatools. If not, see <http://www.gnu.org/licenses/>.
29 
30 // - Deprecation attribute -
31 // NB check non gnu first because __GNUC__ can be defined by compilers
32 // suporting the GNU extensions!
33 #if defined(__clang__)
34 #if __has_extension(attribute_deprecated_with_message)
35 #define DATATOOLS_DEPRECATED(Message) __attribute__((deprecated(Message)))
36 #else
37 #define DATATOOLS_DEPRECATED(Message) __attribute__((deprecated))
38 #endif
39 
40 #elif defined(__INTEL_COMPILER)
41 #define DATATOOLS_DEPRECATED(Message) __attribute__((deprecated))
42 
43 #elif defined(_MSC_VER)
44 #define DATATOOLS_DEPRECATED(Message) __declspec(deprecated(Message))
45 
46 #elif defined(__GNUC__)
47 // Version macro as recommended by the Pre-defined Compiler Macros Project
48 // http://sourceforge.net/p/predef/wiki/Home/
49 #if defined(__GNUC_PATCHLEVEL__)
50 #define __GNUC_VERSION__ (__GNUC__ * 10000 \
51  + __GNUC_MINOR__ * 100 \
52  + __GNUC_PATCHLEVEL__)
53 #else
54 #define __GNUC_VERSION__ (__GNUC__ * 10000 \
55  + __GNUC_MINOR__ * 100)
56 #endif
57 #if __GNUC_VERSION__ < 40500
58 #define DATATOOLS_DEPRECATED(Message) __attribute__((deprecated))
59 #else
60 #define DATATOOLS_DEPRECATED(Message) __attribute__((deprecated(Message)))
61 #endif
62 
63 #else
64 #warning "No DATATOOLS_DEPRECATION available - check your use of the datatools API"
65 #endif
66 
67 // Local Variables: --
68 // mode: c++ --
69 // c-file-style: "gnu" --
70 // tab-width: 2 --
71 // End: --