1 /*
2  * Cogl
3  *
4  * A Low Level GPU Graphics and Utilities API
5  *
6  * Copyright (C) 2012 Intel Corporation
7  *
8  * Permission is hereby granted, free of charge, to any person
9  * obtaining a copy of this software and associated documentation
10  * files (the "Software"), to deal in the Software without
11  * restriction, including without limitation the rights to use, copy,
12  * modify, merge, publish, distribute, sublicense, and/or sell copies
13  * of the Software, and to permit persons to whom the Software is
14  * furnished to do so, subject to the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
23  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
24  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26  * SOFTWARE.
27  */
28 
29 #if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION)
30 #error "Only <cogl/cogl.h> can be included directly."
31 #endif
32 
33 #ifndef __COGL_MACROS_H__
34 #define __COGL_MACROS_H__
35 
36 #include <cogl/cogl-version.h>
37 
38 /* These macros are used to mark deprecated functions, and thus have
39  * to be exposed in a public header.
40  *
41  * They are only intended for internal use and should not be used by
42  * other projects.
43  */
44 #if defined(COGL_DISABLE_DEPRECATION_WARNINGS) || defined(COGL_COMPILATION)
45 
46 #define COGL_DEPRECATED
47 #define COGL_DEPRECATED_FOR(f)
48 #define COGL_UNAVAILABLE(maj,min)
49 
50 #else /* COGL_DISABLE_DEPRECATION_WARNINGS */
51 
52 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
53 #define COGL_DEPRECATED __attribute__((__deprecated__))
54 #elif defined(_MSC_VER) && (_MSC_VER >= 1300)
55 #define COGL_DEPRECATED __declspec(deprecated)
56 #else
57 #define COGL_DEPRECATED
58 #endif
59 
60 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
61 #define COGL_DEPRECATED_FOR(f) __attribute__((__deprecated__("Use '" #f "' instead")))
62 #elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320)
63 #define COGL_DEPRECATED_FOR(f) __declspec(deprecated("is deprecated. Use '" #f "' instead"))
64 #else
65 #define COGL_DEPRECATED_FOR(f) G_DEPRECATED
66 #endif
67 
68 #if    __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
69 #define COGL_UNAVAILABLE(maj,min) __attribute__((deprecated("Not available before " #maj "." #min)))
70 #elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320)
71 #define COGL_UNAVAILABLE(maj,min) __declspec(deprecated("is not available before " #maj "." #min))
72 #else
73 #define COGL_UNAVAILABLE(maj,min)
74 #endif
75 
76 #endif /* COGL_DISABLE_DEPRECATION_WARNINGS */
77 
78 #define COGL_EXPORT __attribute__((visibility("default"))) extern
79 
80 #endif /* __COGL_MACROS_H__ */
81