b311480e |
1 | // Copyright (c) 1998-1999 Matra Datavision |
973c2be1 |
2 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
3 | // |
973c2be1 |
4 | // This file is part of Open CASCADE Technology software library. |
b311480e |
5 | // |
973c2be1 |
6 | // This library is free software; you can redistribute it and / or modify it |
7 | // under the terms of the GNU Lesser General Public version 2.1 as published |
8 | // by the Free Software Foundation, with special exception defined in the file |
9 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
10 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
11 | // |
973c2be1 |
12 | // Alternatively, this file may be used under the terms of Open CASCADE |
13 | // commercial license or contractual agreement. |
b311480e |
14 | |
7fd59977 |
15 | // Purpose: This file is intended to be the first file #included to any |
16 | // Open CASCADE source. It defines platform-specific pre-processor |
17 | // macros necessary for correct compilation of Open CASCADE code |
18 | |
19 | #ifndef _Standard_Macro_HeaderFile |
20 | # define _Standard_Macro_HeaderFile |
21 | |
22 | #ifdef HAVE_CONFIG_H |
23 | # include <config.h> |
24 | #endif /* HAVE_CONFIG_H */ |
25 | |
26 | // Standard OCC macros: Handle(), STANDARD_TYPE() |
1c35b92f |
27 | # define Handle(ClassName) Handle_##ClassName |
7fd59977 |
28 | # define STANDARD_TYPE(aType) aType##_Type_() |
29 | |
30 | //====================================================== |
31 | // Windows-specific definitions |
32 | //====================================================== |
33 | |
34 | // check if WNT macro is not defined but compiler is MSVC |
35 | #if defined(_MSC_VER) && !defined(WNT) |
36 | #error "Wrong compiler options has been detected. Add /DWNT option for proper compilation!!!!!" |
37 | #endif |
38 | |
39 | # if defined(WNT) && !defined(HAVE_NO_DLL) |
40 | |
41 | # ifndef Standard_EXPORT |
42 | # define Standard_EXPORT __declspec( dllexport ) |
43 | // For global variables : |
44 | # define Standard_EXPORTEXTERN __declspec( dllexport ) extern |
45 | # define Standard_EXPORTEXTERNC extern "C" __declspec( dllexport ) |
46 | # endif /* Standard_EXPORT */ |
47 | |
48 | # ifndef Standard_IMPORT |
49 | # define Standard_IMPORT __declspec( dllimport ) extern |
50 | # define Standard_IMPORTC extern "C" __declspec( dllimport ) |
51 | # endif /* Standard_IMPORT */ |
52 | |
53 | // We must be careful including windows.h: it is really poisonous stuff! |
54 | // The most annoying are #defines of many identifiers that you could use in |
55 | // normal code without knowing that Windows has its own knowledge of them... |
56 | // So lets protect ourselves by switching OFF as much as possible of this in advance. |
57 | // If someone needs more from windows.h, he is encouraged to #undef these symbols |
58 | // or include windows.h prior to any OCCT stuff. |
59 | // Note that we define each symbol to itself, so that it still can be used |
60 | // e.g. as name of variable, method etc. |
61 | #ifndef WIN32_LEAN_AND_MEAN |
62 | #define WIN32_LEAN_AND_MEAN /* exclude extra Windows stuff */ |
63 | #endif |
64 | #ifndef NOMINMAX |
65 | #define NOMINMAX NOMINMAX /* avoid #define min() and max() */ |
66 | #endif |
67 | #ifndef NOMSG |
68 | #define NOMSG NOMSG /* avoid #define SendMessage etc. */ |
69 | #endif |
70 | #ifndef NODRAWTEXT |
71 | #define NODRAWTEXT NODRAWTEXT /* avoid #define DrawText etc. */ |
72 | #endif |
73 | #ifndef NONLS |
74 | #define NONLS NONLS /* avoid #define CompareString etc. */ |
75 | #endif |
76 | #ifndef NOGDI |
77 | #define NOGDI NOGDI /* avoid #define SetPrinter (winspool.h) etc. */ |
78 | #endif |
79 | #ifndef NOSERVICE |
80 | #define NOSERVICE NOSERVICE |
81 | #endif |
82 | #ifndef NOKERNEL |
83 | #define NOKERNEL NOKERNEL |
84 | #endif |
85 | #ifndef NOUSER |
86 | #define NOUSER NOUSER |
87 | #endif |
88 | #ifndef NOMCX |
89 | #define NOMCX NOMCX |
90 | #endif |
91 | #ifndef NOIME |
92 | #define NOIME NOIME |
93 | #endif |
94 | |
95 | # else /* WNT */ |
96 | |
97 | //====================================================== |
98 | // UNIX definitions |
99 | //====================================================== |
100 | |
101 | # ifndef Standard_EXPORT |
102 | # define Standard_EXPORT |
103 | // For global variables : |
104 | # define Standard_EXPORTEXTERN extern |
105 | # define Standard_EXPORTEXTERNC extern "C" |
106 | # endif /* Standard_EXPORT */ |
107 | |
108 | # ifndef Standard_IMPORT |
109 | # define Standard_IMPORT extern |
110 | # define Standard_IMPORTC extern "C" |
111 | # endif /* Standard_IMPORT */ |
112 | |
113 | // Compatibility with old SUN compilers |
114 | |
115 | // This preprocessor directive is a kludge to get around |
116 | // a bug in the Sun Workshop 5.0 compiler, it keeps the |
117 | // /usr/include/memory.h file from being #included |
118 | // with an incompatible extern "C" definition of memchr |
119 | // October 18, 2000 <rboehne@ricardo-us.com> |
120 | #if __SUNPRO_CC_COMPAT == 5 |
121 | #define _MEMORY_H |
122 | #endif |
123 | |
124 | # endif /* WNT */ |
125 | |
126 | //====================================================== |
127 | // Other |
128 | //====================================================== |
129 | |
130 | # ifndef __Standard_API |
131 | //# ifdef WNT |
132 | # if !defined(WNT) || defined(__Standard_DLL) || defined(__FSD_DLL) || defined(__MMgt_DLL) || defined(__OSD_DLL) || defined(__Plugin_DLL) || defined(__Quantity_DLL) || defined(__Resource_DLL) || defined(__SortTools_DLL) || defined(__StdFail_DLL) || defined(__Storage_DLL) || defined(__TColStd_DLL) || defined(__TCollection_DLL) || defined(__TShort_DLL) || defined(__Units_DLL) || defined(__UnitsAPI_DLL) || defined(__Dico_DLL) |
133 | # define __Standard_API Standard_EXPORT |
134 | # define __Standard_APIEXTERN Standard_EXPORTEXTERN |
135 | # else |
136 | # define __Standard_API Standard_IMPORT |
137 | # define __Standard_APIEXTERN Standard_IMPORT |
138 | # endif // __Standard_DLL |
139 | //# else |
140 | //# define __Standard_API |
141 | //# endif // WNT |
142 | # endif // __Standard_API |
143 | |
7fd59977 |
144 | #endif |