Initial revision
[moose.git] / bootstrap / platform.h
bloba48820d3ad5d3dcbd78b4d183bc87adc11eaa3cb
1 /* Moose Programming Language
2 * (c) Jeremy Tregunna, 2006, All Rights Reserved.
3 */
5 #ifndef __MOOSE__PLATFORM_H
6 #define __MOOSE__PLATFORM_H
8 #ifdef __cplusplus
9 # define MOOSE_BEGIN_DECLS extern "C" {
10 # define MOOSE_END_DECLS }
11 #else
12 # define MOOSE_BEGIN_DECLS
13 # define MOOSE_END_DECLS
14 #endif /* __cplusplus */
16 /* Unix platforms that don't -Dunix */
17 #ifndef unix
18 # ifdef __APPLE__
19 /* Make sure we're running OS X previous versions of Mac OS define __APPLE__ */
20 # ifdef __MACH__
21 # define unix
22 # else
23 # error "Moose is not supported on your version of Mac OS."
24 # endif /* __MACH__ */
25 # endif /* __APPLE__ */
26 # ifdef __NetBSD__
27 # define unix
28 # endif /* __NetBSD__ */
29 # ifdef __unix__
30 # define unix
31 # endif /* __unix__ */
32 #endif /* !unix */
34 /* Assertaion C99 compatibility */
35 #if !(defined(__STDC__) && defined(__STDC_VERSION__) \
36 && __STDC_VERSION__ >= 199901L)
37 # error "An ISO-C99 compiler is required."
38 #endif
40 #if defined(WIN32)
41 # if defined(__MINGW__) || defined(_MSC_VER)
42 # define MOOSE_INLINE __inline
43 # else
44 # define MOOSE_INLINE inline
45 # endif
46 # ifdef MOOSE_EXPORTS
47 # define MOOSE_API __declspec(dllexport)
48 # else
49 # define MOOSE_API __declspec(dllimport)
50 # endif
51 #else
52 # define MOOSE_INLINE inline
53 # define MOOSE_API
54 #endif
56 #endif /* __MOOSE__PLATFORM_H */