blob: 748e6829e6b754898cb3f84170ebc0280a0933ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
// Copyright (C) by Josh Blum. See LICENSE.txt for licensing information.
#ifndef INCLUDED_GRAS_GRAS_HPP
#define INCLUDED_GRAS_GRAS_HPP
#include <ciso646>
// http://gcc.gnu.org/wiki/Visibility
// Generic helper definitions for shared library support
#if defined _WIN32 || defined __CYGWIN__
#define GRAS_HELPER_DLL_IMPORT __declspec(dllimport)
#define GRAS_HELPER_DLL_EXPORT __declspec(dllexport)
#define GRAS_HELPER_DLL_LOCAL
#else
#if __GNUC__ >= 4
#define GRAS_HELPER_DLL_IMPORT __attribute__ ((visibility ("default")))
#define GRAS_HELPER_DLL_EXPORT __attribute__ ((visibility ("default")))
#define GRAS_HELPER_DLL_LOCAL __attribute__ ((visibility ("hidden")))
#else
#define GRAS_HELPER_DLL_IMPORT
#define GRAS_HELPER_DLL_EXPORT
#define GRAS_HELPER_DLL_LOCAL
#endif
#endif
#define GRAS_DLL //always build a dll
// Now we use the generic helper definitions above to define GRAS_API and GRAS_LOCAL.
// GRAS_API is used for the public API symbols. It either DLL imports or DLL exports (or does nothing for static build)
// GRAS_LOCAL is used for non-api symbols.
#ifdef GRAS_DLL // defined if GRAS is compiled as a DLL
#ifdef GRAS_DLL_EXPORTS // defined if we are building the GRAS DLL (instead of using it)
#define GRAS_API GRAS_HELPER_DLL_EXPORT
#define GRAS_EXTERN
#else
#define GRAS_API GRAS_HELPER_DLL_IMPORT
#define GRAS_EXTERN extern
#endif // GRAS_DLL_EXPORTS
#define GRAS_LOCAL GRAS_HELPER_DLL_LOCAL
#else // GRAS_DLL is not defined: this means GRAS is a static lib.
#define GRAS_API
#define GRAS_LOCAL
#define GRAS_EXTERN
#endif // GRAS_DLL
#define GRAS_MAX_ALIGNMENT 64
//define cross platform attribute macros
#if defined(GRAS_DEBUG)
#define GRAS_FORCE_INLINE inline
#elif defined(BOOST_MSVC)
#define GRAS_FORCE_INLINE __forceinline
#elif defined(__GNUG__) && __GNUG__ >= 4
#define GRAS_FORCE_INLINE inline __attribute__((always_inline))
#else
#define GRAS_FORCE_INLINE inline
#endif
namespace gras
{
//! Typedef for absolute item indexes
typedef unsigned long long item_index_t;
}
#endif /*INCLUDED_GRAS_GRAS_HPP*/
|