2
* Copyright 2010 Inalogic Inc.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License version 3, as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranties of
10
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
11
* PURPOSE. See the applicable version of the GNU Lesser General Public
12
* License for more details.
14
* You should have received a copy of both the GNU Lesser General Public
15
* License version 3 along with this program. If not, see
16
* <http://www.gnu.org/licenses/>
18
* Authored by: Jay Taoko <jaytaoko@inalogic.com>
31
#define NUX_OS_WINDOWS
39
#define NUX_GNUC_COMPILER
41
#define NUX_GNUCPP_COMPILER
43
#error Support only g++.
47
#define NUX_COMPILER_STRING "GNU CPP Compiler"
51
#define NUX_BUILD_STRING "Debug build compiled with " NUX_COMPILER_STRING
53
#define NUX_BUILD_STRING "Compiled with " NUX_COMPILER_STRING
58
#define NUX_APPLE_COMPILER
61
#if defined(_M_X64) || defined(__amd64__) || defined(__ia64__)
63
#elif defined(_M_IX86) || defined(__i386__)
65
#elif defined(__arm__)
72
#define NUX_MICROSOFT_COMPILER
76
// NUX_GNUCPP_COMPILER
77
// NUX_MICROSOFT_COMPILER
87
// Add lib DbgHelp.lib for the following function
89
// SymFunctionTableAccess64
92
// SymGetLineFromAddr64
93
// SymGetSymFromAddr64
98
#pragma comment(lib, "DbgHelp")
100
// _MSC_VER: Defines the major and minor versions of the compiler. For example, 1300 for Microsoft Visual C++ .NET. 1300 represents version 13
101
// and no point release. This represents the fact that there have been a total of 13 releases of the compiler.
102
// If you type cl /? at the command line, you will see the full version for the compiler you are using.
105
#error Support only Visual Studio Compiler.
108
#define VISUAL_STUDIO_2008_COMPILER 1500
109
#define VISUAL_STUDIO_2005_COMPILER 1400
110
#define VISUAL_STUDIO_2003_COMPILER 1310
113
#define NUX_VISUAL_STUDIO_2008
114
#elif _MSC_VER >= 1400
115
#define NUX_VISUAL_STUDIO_2005
116
#elif _MSC_VER >= 1310
117
#define NUX_VISUAL_STUDIO_2003
121
#if (_MSC_VER >= VISUAL_STUDIO_2008_COMPILER)
122
#define NUX_COMPILER_STRING "Visual Studio 2008"
123
#elif (_MSC_VER >= VISUAL_STUDIO_2005_COMPILER)
124
#define NUX_COMPILER_STRING "Visual Studio 2005"
125
#elif (_MSC_VER >= VISUAL_STUDIO_2003_COMPILER)
126
#define NUX_COMPILER_STRING "Visual Studio 2003"
131
#define NUX_BUILD_STRING "Debug build compiled with " NUX_COMPILER_STRING
133
#define NUX_BUILD_STRING "Compiled with " NUX_COMPILER_STRING
137
// Define the proper values for _WIN32_WINNT and WINVER in the compiler response file "compiler_options.h"
138
// Windows Vista _WIN32_WINNT>=0x0600
140
// Windows Server 2003 _WIN32_WINNT>=0x0502
142
// Windows XP _WIN32_WINNT>=0x0501
144
// Windows 2000 _WIN32_WINNT>=0x0500
146
// Windows NT 4.0 _WIN32_WINNT>=0x0400
148
// Windows Me _WIN32_WINDOWS=0x0500
150
// Windows 98 _WIN32_WINDOWS>=0x0410
152
// Windows 95 _WIN32_WINDOWS>=0x0400
156
// Minimum system required Macros to define
157
// Windows Vista NTDDI_VERSION >=NTDDI_LONGHORN
158
// Windows Server 2003 SP1 NTDDI_VERSION >=NTDDI_WS03SP1
159
// Windows Server 2003 NTDDI_VERSION >=NTDDI_WS03
160
// Windows XP SP2 NTDDI_VERSION >=NTDDI_WINXPSP2
161
// Windows XP SP1 NTDDI_VERSION >=NTDDI_WINXPSP1
162
// Windows XP NTDDI_VERSION >=NTDDI_WINXP
163
// Windows 2000 SP4 NTDDI_VERSION >=NTDDI_WIN2KSP4
164
// Windows 2000 SP3 NTDDI_VERSION >=NTDDI_WIN2KSP3
165
// Windows 2000 SP2 NTDDI_VERSION >=NTDDI_WIN2KSP2
166
// Windows 2000 SP1 NTDDI_VERSION >=NTDDI_WIN2KSP1
167
// Windows 2000 NTDDI_VERSION >=NTDDI_WIN2K
169
#define WIN32_LEAN_AND_MEAN 1
176
#if defined(NUX_OS_WINDOWS) && defined(NUX_DEBUG)
177
#define NUX_ENABLE_ASSERT_MACROS
178
#define NUX_ENABLE_LOGGING
179
#elif defined(NUX_OS_LINUX) && defined(NUX_DEBUG)
180
#define NUX_ENABLE_ASSERT_MACROS
181
#define NUX_ENABLE_LOGGING
185
// Specifies that a function should be ignored and the argument list
186
// be parsed but no code be generated for the arguments. It is intended for use in global
187
// debug functions that take a variable number of arguments.
189
#if defined(NUX_MICROSOFT_COMPILER)
190
#define NUX_COMPILER_SUPPORTS_NOOP
191
#define NUX_NOOP __noop
192
#elif defined(NUX_GNUCPP_COMPILER)
193
#define NUX_COMPILER_SUPPORTS_NOOP
194
#define NUX_NOOP __asm__("nop")
197
// Pragma pack support
198
#if defined(NUX_MICROSOFT_COMPILER) || defined(NUX_GNUCPP_COMPILER)
199
#define NUX_SUPPORTS_PRAGMA_PACK
203
// Define variadic macro support
204
#if defined(NUX_MICROSOFT_COMPILER) && (defined(NUX_VISUAL_STUDIO_2005) || defined(NUX_VISUAL_STUDIO_2008))
205
#define NUX_VARIADIC_MACROS_SUPPORT
206
#elif defined(NUX_GNUCPP_COMPILER)
207
#define NUX_VARIADIC_MACROS_SUPPORT
211
/// DLL declaration macros
212
#if defined(NUX_OS_WINDOWS)
214
#if (!defined(_WIN32)) && (!defined(_WIN64))
215
#error("ERROR: Use NUX_DLL is permitted only on win32 & win64 platforms")
218
#define NUX_DECLSPEC_DLLIMPORT __declspec(dllimport)
219
#define NUX_DECLSPEC_DLLEXPORT __declspec(dllexport)
221
#define NUX_DECLSPEC_DLLIMPORT
222
#define NUX_DECLSPEC_DLLEXPORT
225
#ifdef NUX_EXPORT_DLL
226
#define NUX_DECLSPEC_DLL NUX_DECLSPEC_DLLEXPORT
228
#define NUX_DECLSPEC_DLL NUX_DECLSPEC_DLLIMPORT
230
#elif defined(NUX_OS_LINUX)
232
#define NUX_DECLSPEC_DLLIMPORT __attribute__ ((visibility("default")))
233
#define NUX_DECLSPEC_DLLEXPORT __attribute__ ((visibility("default")))
235
#define NUX_DECLSPEC_DLLIMPORT
236
#define NUX_DECLSPEC_DLLEXPORT
239
#ifdef NUX_EXPORT_DLL
240
#define NUX_DECLSPEC_DLL NUX_DECLSPEC_DLLEXPORT
242
#define NUX_DECLSPEC_DLL NUX_DECLSPEC_DLLIMPORT
246
#define NUX_CHECK_PUREVIRTUALS 1
248
// Throwing exceptions:
251
// // if we are in Debug disable exceptions. What we want is to break were and error happens: ie NUX_BREAK_ASM_INT3
252
// #define NUX_EXCEPTIONS_DISABLED 1
255
#define NUX_EXCEPTIONS_DISABLED 1