OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
gnuc.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows, OWL NExt
3// Copyright (c) 1998-1999 by Yura Bidus, All Rights Reserved
4//
5// Compiler-specific defines for GNU C/C++. Included only by
6// defs.h
7//
8//----------------------------------------------------------------------------
9
10#if !defined(OWL_PRIVATE_GNUC_H)
11#define OWL_PRIVATE_GNUC_H
12
13#ifdef __CYGWIN__
14#error only mingw supported now
15#endif
16
17//////////////////////////
18// let STL do some work
19#undef min
20#undef max
21#include <algorithm>
22using std::min;
23using std::max;
24#define __MINMAX_DEFINED //avoid use definition of min max from Borland/others headers
25
26#include <stddef.h>
27#include <exception>
28
29#if !defined(__FLAT__)
30# define __FLAT__
31#endif
32
33// Define library-wide function calling conventions. Must rebuild everything
34// if changed, and must use appropriate modifier on derived classes.
35//
36
37#if !defined(_CCONV)
38# define _CCONV __cdecl
39#endif
40
41
42//
43// Only enable multi-thread classes when the OS supports them, and/or when the
44// runtime library support them
45//
46#define BI_MULTI_THREAD
47
48// GNU suport multithreading ???
49#if defined(__STL_WIN32THREADS)
50#define BI_MULTI_THREAD_RTL
51#endif
52
53//----------------------------------------------------------------------------
54// Compiler-specific flags.
55//----------------------------------------------------------------------------
56// MinGW uses __declspecs, so just turn import/export into those
57// MSVC uses __declspecs, so just turn import/export into those
58
59
60//
61// Specific name of compiler, BI_COMP_xxxx
62//
63#define BI_COMP_GNUC
64#define _RTLENTRY
65#define _USERENTRY
66// uses Microsoft RTL under Windows
67#define _EXPCLASS __declspec(dllimport)
68#define _EXPDATA(type) type __declspec(dllimport)
69#define _EXPFUNC(type) type __declspec(dllimport)
70
71// Debug trap macro
72#define OWL_BREAK __asm__ ("int3");
73
74
75//
76// C++ language features
77//
78// When compiling with a compiler that doesn't support these
79// features directly, remove the // from the appropriate
80// #define below or define the macro in the build environment.
81//
82
83//
84// Language feature: Description SERVICES header
85// ~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
86#if __GNUC__ <4
87# error OWLNext 6.33 and later require version 4 or later of this compiler.
88#endif
89
90//#define BI_NO_NEW_CASTS // New style casts CASTABLE.H
91
92#if !defined(__STL_USE_EXCEPTIONS)
93# define __STL_USE_EXCEPTIONS
94#endif
95
96// change __stl_assert -> OWL alwas GUI application
97#ifdef __STL_ASSERTIONS
98#undef __stl_assert
99# define __stl_assert(expr) CHECK(expr)
100#endif
101
102#define _RTTI // without __rtti keyword //???????????????
103//#define BI_NOTHUNK // not used chunk
104//#define BI_NO_LVAL_CASTS // Can cast lvalues
105//#define BI_VIRTUAL_BUG //??????????????????????????
106
107//JJH just to get rid of warning in wine's basetsd.h header file
108//#if defined(WINELIB)
109//typedef long long __int64;
110//#else
111#if !defined(__int64)
112#define __int64 long long
113#endif
114//#endif
115
116//#define BI_TYPECASTOPERATOR_BUG // problem with type cast operator
117//
118// Aligning for OWL
119//
120#if !defined BI_OWL_PACKING
121#define BI_OWL_PACKING 4 // for ??? default packing
122#endif
123
124#if defined(__MINGW32__)
125# include <owl/private/mingw32.h>
126#elif defined(__CYGWIN__)
127# include <owl/private/cygwin.h>
128#error structured exception handling not yet supported
129#elif defined(WINELIB) //JJH
130# include <owl/private/winelib.h>
131#else
132#error Unknown GNU Compiler
133#endif
134
135#define OWL_OUTPUT_DEBUG_STRING(lpsz) ::OutputDebugString(lpsz)
136
137//need again to undef min/max (check later private/winelib.h->winsock2.h use)
138#undef min
139#undef max
140
141
142#if !defined(_MAX_PATH)
143#define _MAX_PATH MAX_PATH
144#endif
145
146//C runtime equivalents
147#define _stricmp strcasecmp
148#define _strnicmp strncasecmp
149
150//both _fullpath and _wfullpath are in the msvcrt implementation of Winelib (stdlib.h),
151//but we prefer a to use only functions of gnu lib
152#define _fullpath myfullpath //used in file.cpp, implemented in unix.cpp
153
154char *myfullpath(char *,const char *,int );
155
156
157#endif // OWL_PRIVATE_GNUC_H
char * myfullpath(char *, const char *, int)
Definition unix.cpp:41