File: spl_platform.h

package info (click to toggle)
libterralib 4.3.0+dfsg.2-10
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 61,560 kB
  • ctags: 37,110
  • sloc: cpp: 225,052; ansic: 31,562; makefile: 807; sh: 80; xml: 37
file content (132 lines) | stat: -rw-r--r-- 3,383 bytes parent folder | download | duplicates (3)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132

/*!

\section terms_of_use Terms of Use

libspl - the simple plugin layer library.
Copyright (C) 2004 Andreas Loeffler and Ren´┐ŻStuhr (www.unitedbytes.de).

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

\section author Author
Andreas Loeffler (www.unitedbytes.de)

*/

//---------------------------------------------------------------------------------------------------------------------------
/// @file		spl_platform.h
/// @version	1.0
/// @brief		Platform handling & detection.
/// @author		Andreas Loeffler
//---------------------------------------------------------------------------------------------------------------------------

#ifndef		__SPL_PLATFORM_H__
#define		__SPL_PLATFORM_H__

//
// PLATFORM DEFINES
//
#define		SPL_PLATFORM_WIN32			1
#define		SPL_PLATFORM_LINUX			2
#define		SPL_PLATFORM_APPLE			3
#define 	SPL_PLATFORM_SOLARIS			4
#define		SPL_PLATFORM_HURD			5
#define		SPL_PLATFORM_KFREEBSD			6

//
// COMPILER DEFINES
//
#define		SPL_COMPILER_VCPLUSPLUS		1
#define		SPL_COMPILER_BCPLUSPLUS		2
#define		SPL_COMPILER_GNUC			3
#define		SPL_COMPILER_CODEWARRIOR	4
#define		SPL_COMPILER_SUNFORTE7		5

//
// PLATFORM DETECTION
//
#if	defined( WIN32 ) || defined( __WIN32__ ) || defined ( _WIN32 ) || defined( WIN64 ) || defined( _WIN32_WCE )

	#define SPL_PLATFORM				SPL_PLATFORM_WIN32
	
	//
	// Save compile date and time to lib
	//
	#pragma comment( user, "Compiled on " __DATE__ " at " __TIME__ )

#elif defined( __LINUX__ ) || defined( linux ) || defined( __FreeBSD__ )

	#define SPL_PLATFORM				SPL_PLATFORM_LINUX

#elif defined( __GNU__ )

	#define SPL_PLATFORM				SPL_PLATFORM_HURD

#elif defined( __GLIBC__ )

	#define	SPL_PLATFORM				SPL_PLATFORM_KFREEBSD
	
#elif defined( __APPLE_CC__ ) || defined( APPLE_CC )

	#define	SPL_PLATFORM				SPL_PLATFORM_APPLE

#elif defined(sparc) && defined(sun) && defined(unix)	

	//
	// (karg) Solaris port stuff	
	//
	#define SPL_PLATFORM				SPL_PLATFORM_SOLARIS

#else

	#error "ERROR: Operating system is unknown!"

#endif	//	PLATFORM

//
// COMPILER DETECTION
//
#if defined( _MSC_VER )

	#define SPL_COMPILER				SPL_COMPILER_VCPLUSPLUS

#elif defined( __BORLANDC__ ) || defined( __BCPLUSPLUS__ )

	#define SPL_COMPILER				SPL_COMPILER_BCPLUSPLUS

#elif defined( __GNUC__ )

	#define SPL_COMPILER				SPL_COMPILER_GNUC

#elif defined( __MWERKS__ )

	#define SPL_COMPILER				SPL_COMPILER_CODEWARRIOR

#elif defined( __SUNPRO_CC)

	//
	// Sun forte compiler, the solaris port (karg)
	//
	#define SPL_COMPILER				SPL_COMPILER_SUNFORTE7

#else

	#error "ERROR: Compiler is unknown!"

#endif	//	COMPILER


#endif	//	__SPL_PLATFORM_H__