7#if !defined(OWL_PRIVATE_DEFS_H)
8#define OWL_PRIVATE_DEFS_H
10#define SERVICES_DEFS_H
13#if !defined(__cplusplus)
14#error OWLNext requires C++ compilation.
18# error OWLNext requires _WIN32 (_WIN16 is no longer supported).
27#if defined(__DLL__) || defined(_DLL) || defined(_WINDLL)
30# define BI_APP_EXECUTABLE
72#if defined(BI_NEED_PRIVATE_OWLPORT)
73#include <port/owl-port.h>
76#if defined(_OWLDLL) || defined(_BUILDOWLDLL)
92#if defined(__DEBUG) && __DEBUG > 0
99# if !defined(_UNICODE)
105# if !defined(UNICODE)
110#if !defined(OWL_STACKWALKER)
111# define OWL_STACKWALKER 0
113# if OWL_STACKWALKER && !(defined(_MSC_VER) && __DEBUG)
114# error OWL_STACKWALKER is only supported in debug mode for the Microsoft compiler.
120 #define OWL_DISABLE_WARNING_PUSH __pragma(warning( push ))
121 #define OWL_DISABLE_WARNING_POP __pragma(warning( pop ))
122 #define OWL_DISABLE_WARNING(warningNumber) __pragma(warning( disable : warningNumber ))
124 #define OWL_DISABLE_WARNING_UNREFERENCED_FORMAL_PARAMETER OWL_DISABLE_WARNING(4100)
125 #define OWL_DISABLE_WARNING_UNREFERENCED_FUNCTION OWL_DISABLE_WARNING(4505)
128 #define OWL_DISABLE_WARNING_EXTENSION
129 #define OWL_DISABLE_WARNING_ZERO_AS_NULL_POINTER
130 #define OWL_DISABLE_WARNING_OLD_STYLE_CAST
133#elif defined(__clang__) || defined(__GNUC__)
134 #define OWL_DO_PRAGMA_(X) _Pragma(#X)
136 #if defined(__clang__)
137 #define OWL_DISABLE_WARNING_PUSH OWL_DO_PRAGMA_(clang diagnostic push)
138 #define OWL_DISABLE_WARNING_POP OWL_DO_PRAGMA_(clang diagnostic pop)
139 #define OWL_DISABLE_WARNING(warningName) OWL_DO_PRAGMA_(clang diagnostic ignored #warningName)
140 #elif defined(__GNUC__)
141 #define OWL_DISABLE_WARNING_PUSH OWL_DO_PRAGMA_(GCC diagnostic push)
142 #define OWL_DISABLE_WARNING_POP OWL_DO_PRAGMA_(GCC diagnostic pop)
143 #define OWL_DISABLE_WARNING(warningName) OWL_DO_PRAGMA_(GCC diagnostic ignored #warningName)
146 #define OWL_DISABLE_WARNING_UNREFERENCED_FORMAL_PARAMETER OWL_DISABLE_WARNING(-Wunused-parameter)
147 #define OWL_DISABLE_WARNING_UNREFERENCED_FUNCTION OWL_DISABLE_WARNING(-Wunused-function)
148 #define OWL_DISABLE_WARNING_EXTENSION OWL_DISABLE_WARNING(-Wlanguage-extension-token)
149 #define OWL_DISABLE_WARNING_ZERO_AS_NULL_POINTER OWL_DISABLE_WARNING(-Wzero-as-null-pointer-constant)
150 #define OWL_DISABLE_WARNING_OLD_STYLE_CAST OWL_DISABLE_WARNING(-Wold-style-cast)
155 #define OWL_DISABLE_WARNING_PUSH
156 #define OWL_DISABLE_WARNING_POP
157 #define OWL_DISABLE_WARNING_UNREFERENCED_FORMAL_PARAMETER
158 #define OWL_DISABLE_WARNING_UNREFERENCED_FUNCTION
159 #define OWL_DISABLE_WARNING_EXTENSION
160 #define OWL_DISABLE_WARNING_ZERO_AS_NULL_POINTER
161 #define OWL_DISABLE_WARNING_OLD_STYLE_CAST
166#if defined(__BORLANDC__)
168#elif defined(_MSC_VER)
170#elif defined(__GNUC__)
172#elif defined(__WATCOMC__)
173# error Watcom currently not supported
174#elif defined(__FORTE__)
175# error Forte currently not supported
177#error Unknown compiler
184#if !defined(OWL_BREAK)
186# define OWL_BREAK assert("OWLNext Debug Break" && false);
191#if !defined(BI_OWL_PACKING)
192#define BI_OWL_PACKING 1
196#if defined(NO_OWL_NATIVECTRL_ALWAYS)
197#error OWLNext: NO_OWL_NATIVECTRL_ALWAYS is obsolete build options.
200#if defined(OWL_NATIVECTRL_NEVER)
201#error OWLNext: OWL_NATIVECTRL_NEVER is obsolete build options.
208#if defined(OWL1_COMPAT) || defined(OWL2_COMPAT) || defined(NO_OWL1_COMPAT) || defined(NO_OWL2_COMPAT) || defined(NO_OWL5_COMPAT)
209#error OWLNext: OWL1_COMPAT and OWL2_COMPAT (as well as NO_OWL?_COMPAT variants) are obsolete build options.
212#if defined(NO_OWL5_COMPAT)
213#pragma message("OWLNext: The NO_OWL5_COMPAT build option is obsolete.")
269# define TYPESAFE_DOWNCAST(object,toClass)\
270 dynamic_cast<toClass * >(object)
271# define STATIC_CAST(targetType,object) \
272 static_cast<targetType >(object)
273# define CONST_CAST(targetType,object) \
274 const_cast<targetType >(object)
275# define REINTERPRET_CAST(targetType,object) \
276 reinterpret_cast<targetType >(object)
278# define GET_CLASS_CASTABLE_ID(classtype) typeid( classtype ).name()
279# define GET_OBJECT_CASTABLE_ID(object) typeid( object ).name()
289# define BI_UNIQUE_BOOL
291 template<
class T>
inline bool ToBool(
const T& t) {
301#define _OWLEXPORTDATA(p) __declspec(dllexport) p
302#define _OWLEXPORTFUNC(p) __declspec(dllexport) p
303#define _OWLEXPORTCFUNC(p) __declspec(dllexport) p _CCONV
304#define _OWLIMPORTDATA(p) __declspec(dllimport) p
305#define _OWLIMPORTFUNC(p) __declspec(dllimport) p
306#define _OWLIMPORTCFUNC(p) __declspec(dllimport) p _CCONV
307#define _OWLSTATICDATA(p) p
308#define _OWLSTATICFUNC(p) p
309#define _OWLSTATICCFUNC(p) p _CCONV
311#define _OWLEXPORTCLASS __declspec(dllexport)
312#define _OWLEXPORTCLASS_RTL __declspec(dllexport)
313#define _OWLIMPORTCLASS __declspec(dllimport)
314#define _OWLIMPORTCLASS_RTL __declspec(dllimport)
315#define _OWLSTATICCLASS
316#define _OWLSTATICCLASS_RTL
318#if defined(_BUILDOWLDLL)
321# if !defined(_OWLCLASS)
322# define _OWLCLASS _OWLEXPORTCLASS
325# if !defined(_OWLCLASS_RTL)
326# define _OWLCLASS_RTL _OWLEXPORTCLASS_RTL
328# define _OWLDATA _OWLEXPORTDATA
329# define _OWLFUNC _OWLEXPORTFUNC
330# define _OWLCFUNC _OWLEXPORTCFUNC
331#elif defined(_OWLDLL)
332# define _OWLCLASS _OWLIMPORTCLASS
333# define _OWLCLASS_RTL _OWLIMPORTCLASS_RTL
334# define _OWLDATA _OWLIMPORTDATA
335# define _OWLFUNC _OWLIMPORTFUNC
336# define _OWLCFUNC _OWLIMPORTCFUNC
339# define _OWLCLASS_RTL
340# define _OWLDATA(p) p
341# define _OWLFUNC(p) p
342# define _OWLCFUNC(p) p _CCONV
345#define DECLARE_FUNC(rparm,ctype,fname) rparm (ctype fname)
361#define _CCONV __cdecl
364#if !defined(BI_NO_SWAP_TMPL)
365template <
class T>
inline void Swap( T &
a, T &
b ) {
376#define COUNTOF(s) (sizeof(s) / sizeof((s)[0]))
378#if defined(BI_NOTHUNK)
379#pragma message("OWLNext: BI_NOTHUNK is unsafe and deprecated.")
Compiler-specific defines for Clang-based Embarcadero compilers.
Object Windows Library (OWLNext Core)
#define STATIC_CAST(targetType, object)