mesa: consolidate PUBLIC macro definition
Define the macro in src/util/macros.h rather than in two different places. Note that USED isn't actually used anywhere at this time. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
This commit is contained in:
@@ -111,18 +111,6 @@ typedef unsigned char boolean;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Function visibility */
|
|
||||||
#ifndef PUBLIC
|
|
||||||
# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
|
|
||||||
# define PUBLIC __attribute__((visibility("default")))
|
|
||||||
# elif defined(_MSC_VER)
|
|
||||||
# define PUBLIC __declspec(dllexport)
|
|
||||||
# else
|
|
||||||
# define PUBLIC
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* XXX: Use standard `__func__` instead */
|
/* XXX: Use standard `__func__` instead */
|
||||||
#ifndef __FUNCTION__
|
#ifndef __FUNCTION__
|
||||||
# define __FUNCTION__ __func__
|
# define __FUNCTION__ __func__
|
||||||
|
@@ -83,26 +83,6 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PUBLIC/USED macros
|
|
||||||
*
|
|
||||||
* If we build the library with gcc's -fvisibility=hidden flag, we'll
|
|
||||||
* use the PUBLIC macro to mark functions that are to be exported.
|
|
||||||
*
|
|
||||||
* We also need to define a USED attribute, so the optimizer doesn't
|
|
||||||
* inline a static function that we later use in an alias. - ajax
|
|
||||||
*/
|
|
||||||
#ifndef PUBLIC
|
|
||||||
# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
|
|
||||||
# define PUBLIC __attribute__((visibility("default")))
|
|
||||||
# define USED __attribute__((used))
|
|
||||||
# else
|
|
||||||
# define PUBLIC
|
|
||||||
# define USED
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* XXX: Use standard `__func__` instead */
|
/* XXX: Use standard `__func__` instead */
|
||||||
#ifndef __FUNCTION__
|
#ifndef __FUNCTION__
|
||||||
# define __FUNCTION__ __func__
|
# define __FUNCTION__ __func__
|
||||||
|
@@ -156,4 +156,27 @@ do { \
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PUBLIC/USED macros
|
||||||
|
*
|
||||||
|
* If we build the library with gcc's -fvisibility=hidden flag, we'll
|
||||||
|
* use the PUBLIC macro to mark functions that are to be exported.
|
||||||
|
*
|
||||||
|
* We also need to define a USED attribute, so the optimizer doesn't
|
||||||
|
* inline a static function that we later use in an alias. - ajax
|
||||||
|
*/
|
||||||
|
#ifndef PUBLIC
|
||||||
|
# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
|
||||||
|
# define PUBLIC __attribute__((visibility("default")))
|
||||||
|
# define USED __attribute__((used))
|
||||||
|
# elif defined(_MSC_VER)
|
||||||
|
# define PUBLIC __declspec(dllexport)
|
||||||
|
# define USED
|
||||||
|
# else
|
||||||
|
# define PUBLIC
|
||||||
|
# define USED
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif /* UTIL_MACROS_H */
|
#endif /* UTIL_MACROS_H */
|
||||||
|
Reference in New Issue
Block a user