aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon/llpreprocessor.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llcommon/llpreprocessor.h')
-rw-r--r--linden/indra/llcommon/llpreprocessor.h115
1 files changed, 115 insertions, 0 deletions
diff --git a/linden/indra/llcommon/llpreprocessor.h b/linden/indra/llcommon/llpreprocessor.h
new file mode 100644
index 0000000..f03fe89
--- /dev/null
+++ b/linden/indra/llcommon/llpreprocessor.h
@@ -0,0 +1,115 @@
1/**
2 * @file llpreprocessor.h
3 * @brief This file should be included in all Linden Lab files and
4 * should only contain special preprocessor directives
5 *
6 * Copyright (c) 2001-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#ifndef LLPREPROCESSOR_H
30#define LLPREPROCESSOR_H
31
32// Figure out endianness of platform
33#ifdef LL_LINUX
34#define __ENABLE_WSTRING
35#include <endian.h>
36#endif // LL_LINUX
37
38#if (defined(LL_WINDOWS) || (defined(LL_LINUX) && (__BYTE_ORDER == __LITTLE_ENDIAN)) || (defined(LL_DARWIN) && defined(__LITTLE_ENDIAN__)))
39#define LL_LITTLE_ENDIAN 1
40#else
41#define LL_BIG_ENDIAN 1
42#endif
43
44// Per-OS feature switches.
45
46#if LL_DARWIN
47 #define LL_QUICKTIME_ENABLED 1
48 #define LL_LIBXUL_ENABLED 1
49#elif LL_WINDOWS
50 #define LL_QUICKTIME_ENABLED 1
51 #define LL_LIBXUL_ENABLED 1
52#elif LL_LINUX
53 #define LL_QUICKTIME_ENABLED 0
54 #define LL_LIBXUL_ENABLED 0
55#endif
56
57#if LL_LIBXUL_ENABLED && !defined(MOZILLA_INTERNAL_API)
58 // Without this, nsTAString.h errors out with:
59 // "Cannot use internal string classes without MOZILLA_INTERNAL_API defined. Use the frozen header nsStringAPI.h instead."
60 // It might be worth our while to figure out if we can use the frozen apis at some point...
61 #define MOZILLA_INTERNAL_API 1
62#endif
63
64// Deal with minor differences on Unixy OSes.
65#if LL_DARWIN || LL_LINUX
66 #define GCC_VERSION (__GNUC__ * 10000 \
67 + __GNUC_MINOR__ * 100 \
68 + __GNUC_PATCHLEVEL__)
69
70 // Different name, same functionality.
71 #define stricmp strcasecmp
72 #define strnicmp strncasecmp
73
74 // Not sure why this is different, but...
75 #ifndef MAX_PATH
76 #define MAX_PATH PATH_MAX
77 #endif // not MAX_PATH
78
79#endif
80
81// Deal with the differeneces on Windows
82#if defined(LL_WINDOWS)
83#define snprintf _snprintf
84#endif // LL_WINDOWS
85
86// Static linking with apr on windows needs to be declared.
87#ifdef LL_WINDOWS
88#ifndef APR_DECLARE_STATIC
89#define APR_DECLARE_STATIC // For APR on Windows
90#endif
91#ifndef APU_DECLARE_STATIC
92#define APU_DECLARE_STATIC // For APR util on Windows
93#endif
94#endif
95
96#if defined(LL_WINDOWS)
97#define BOOST_REGEX_NO_LIB 1
98#define CURL_STATICLIB 1
99#endif // LL_WINDOWS
100
101
102// Deal with VC6 problems
103#if defined(LL_WINDOWS)
104#pragma warning( 3 : 4701 ) // "local variable used without being initialized" Treat this as level 3, not level 4.
105#pragma warning( 3 : 4702 ) // "unreachable code" Treat this as level 3, not level 4.
106#pragma warning( 3 : 4189 ) // "local variable initialized but not referenced" Treat this as level 3, not level 4.
107//#pragma warning( 3 : 4018 ) // "signed/unsigned mismatch" Treat this as level 3, not level 4.
108#pragma warning( 3 : 4265 ) // "class has virtual functions, but destructor is not virtual"
109#pragma warning( disable : 4786 ) // silly MS warning deep inside their <map> include file
110#pragma warning( disable : 4284 ) // silly MS warning deep inside their <map> include file
111#pragma warning( disable : 4503 ) // 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation.
112#pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
113#endif // LL_WINDOWS
114
115#endif // not LL_LINDEN_PREPROCESSOR_H