4
* Copyright (C) 2010 Eric Day (eday@oddments.org)
7
* Use and distribution licensed under the BSD license. See the
8
* COPYING file in the root project directory for full text.
13
* @brief Common Declarations and Macros
16
#ifndef SCALESTACK_COMMON_H
17
#define SCALESTACK_COMMON_H
25
* Be sure to put SCALESTACK_API in front of all public API symbols, or one of
26
* the other macros as appropriate. The default visibility without a macro is
27
* to be hidden (SCALESTACK_LOCAL).
30
#if defined(BUILDING_SCALESTACK) && defined(HAVE_VISIBILITY)
31
# if defined(__GNUC__)
32
# define SCALESTACK_API __attribute__ ((visibility("default")))
33
# define SCALESTACK_INTERNAL_API __attribute__ ((visibility("hidden")))
34
# define SCALESTACK_API_DEPRECATED __attribute__ ((deprecated,visibility("default")))
35
# define SCALESTACK_LOCAL __attribute__ ((visibility("hidden")))
36
# elif (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)) || (defined(__SUNPRO_CC) && (__SUNPRO_CC >= 0x550))
37
# define SCALESTACK_API __global
38
# define SCALESTACK_INTERNAL_API __hidden
39
# define SCALESTACK_API_DEPRECATED __global
40
# define SCALESTACK_LOCAL __hidden
41
# elif defined(_MSC_VER)
42
# define SCALESTACK_API extern __declspec(dllexport)
43
# define SCALESTACK_INTERNAL_API extern __declspec(dllexport)
44
# define SCALESTACK_DEPRECATED_API extern __declspec(dllexport)
45
# define SCALESTACK_LOCAL
47
#else /* defined(BUILDING_SCALESTACK) && defined(HAVE_VISIBILITY) */
48
# if defined(_MSC_VER)
49
# define SCALESTACK_API extern __declspec(dllimport)
50
# define SCALESTACK_INTERNAL_API extern __declspec(dllimport)
51
# define SCALESTACK_API_DEPRECATED extern __declspec(dllimport)
52
# define SCALESTACK_LOCAL
54
# define SCALESTACK_API
55
# define SCALESTACK_INTERNAL_API
56
# define SCALESTACK_API_DEPRECATED
57
# define SCALESTACK_LOCAL
58
# endif /* defined(_MSC_VER) */
59
#endif /* defined(BUILDING_SCALESTACK) && defined(HAVE_VISIBILITY) */
62
* Macro that defines the current API version to use for interfaces.
64
#define ScaleStackCurrentAPIVersion @LIBSCALESTACK_VERSION_CURRENT@
67
* Macro used for converting defined values into quoted strings.
69
#define ScaleStackQuote(string) #string
70
#define ScaleStackQuoteValue(string) ScaleStackQuote(string)
73
* Macro to keep new exception declarations small, this should appeat in
76
#define ScaleStackException(name) \
77
class SCALESTACK_API name: public std::exception \
80
virtual const char* what() const throw(); \
84
* Macro for what() method for exceptions, this should appear in the source
87
#define ScaleStackExceptionMessage(name, message) \
88
const char* name::what() const throw() { return message; } \
91
* Functor to use with containers of pointers when the objects should be
98
void operator()(const T* pointer) const
104
} /* namespace ScaleStack */
106
#endif /* SCALESTACK_COMMON_H */