Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygen_windows.h
Go to the documentation of this file.
00001 /* 00002 * Copyright (c) 1997-1999 00003 * Silicon Graphics Computer Systems, Inc. 00004 * 00005 * Copyright (c) 1999 00006 * Boris Fomitchev 00007 * 00008 * Copyright (c) 2003 00009 * Francois Dumont 00010 * 00011 * This material is provided "as is", with absolutely no warranty expressed 00012 * or implied. Any use is at your own risk. 00013 * 00014 * Permission to use or copy this software for any purpose is hereby granted 00015 * without fee, provided the above notices are retained on all copies. 00016 * Permission to modify the code and to distribute modified code is granted, 00017 * provided the above notices are retained, and a notice that the code was 00018 * modified is included with the above copyright notice. 00019 * 00020 */ 00021 #ifndef _STLP_INTERNAL_WINDOWS_H 00022 #define _STLP_INTERNAL_WINDOWS_H 00023 00024 #if !defined (_STLP_PLATFORM) 00025 # define _STLP_PLATFORM "Windows" 00026 #endif 00027 00028 #if !defined (_STLP_BIG_ENDIAN) && !defined (_STLP_LITTLE_ENDIAN) 00029 # if defined (_MIPSEB) 00030 # define _STLP_BIG_ENDIAN 1 00031 # endif 00032 # if defined (__i386) || defined (_M_IX86) || defined (_M_ARM) || \ 00033 defined (__amd64__) || defined (_M_AMD64) || defined (__x86_64__) || \ 00034 defined (__alpha__) 00035 # define _STLP_LITTLE_ENDIAN 1 00036 # endif 00037 # if defined (__ia64__) 00038 /* itanium allows both settings (for instance via gcc -mbig-endian) - hence a seperate check is required */ 00039 # if defined (__BIG_ENDIAN__) 00040 # define _STLP_BIG_ENDIAN 1 00041 # else 00042 # define _STLP_LITTLE_ENDIAN 1 00043 # endif 00044 # endif 00045 #endif /* _STLP_BIG_ENDIAN */ 00046 00047 #if !defined (_STLP_WINDOWS_H_INCLUDED) 00048 # define _STLP_WINDOWS_H_INCLUDED 00049 # if defined (__BUILDING_STLPORT) 00050 # include <stl/config/_native_headers.h> 00051 /* Here we define _STLP_OUTERMOST_HEADER_ID to avoid indirect inclusion 00052 * of STLport stuffs from C/C++ Standard headers exposed by STLport 00053 * as configuration is not yet completed. */ 00054 # if !defined (_STLP_OUTERMOST_HEADER_ID) 00055 # define _STLP_OUTERMOST_HEADER_ID 0x100 00056 # endif 00057 # if !defined (WIN32_LEAN_AND_MEAN) 00058 # define WIN32_LEAN_AND_MEAN 00059 # endif 00060 # if !defined (VC_EXTRALEAN) 00061 # define VC_EXTRALEAN 00062 # endif 00063 /* Don't let windows.h define its min and max macros. */ 00064 # if !defined (NOMINMAX) 00065 # define NOMINMAX 00066 # endif 00067 # if !defined (STRICT) 00068 # define STRICT 00069 # endif 00070 # if defined (_STLP_USE_MFC) 00071 # include <afx.h> 00072 # else 00073 # include <windows.h> 00074 # endif 00075 # if (_STLP_OUTERMOST_HEADER_ID == 0x100) 00076 # undef _STLP_OUTERMOST_HEADER_ID 00077 # endif 00078 # else 00079 /* This section serves as a replacement for windows.h header. */ 00080 # if defined (__cplusplus) 00081 extern "C" { 00082 # endif 00083 # if (defined (_M_AMD64) || defined (_M_IA64) || (!defined (_STLP_WCE) && defined (_M_MRX000)) || defined (_M_ALPHA) || \ 00084 (defined (_M_PPC) && (_STLP_MSVC_LIB >= 1000))) && !defined (RC_INVOKED) 00085 # define InterlockedIncrement _InterlockedIncrement 00086 # define InterlockedDecrement _InterlockedDecrement 00087 # define InterlockedExchange _InterlockedExchange 00088 # define _STLP_STDCALL 00089 # else 00090 # if defined (_MAC) 00091 # define _STLP_STDCALL _cdecl 00092 # else 00093 # define _STLP_STDCALL __stdcall 00094 # endif 00095 # endif 00096 00097 # if defined (_STLP_NEW_PLATFORM_SDK) && !defined(_WDMDDK_) 00098 /* Define WIN32_NO_STATUS to prevent status codes redefinitions */ 00099 # if !defined(WIN32_NO_STATUS) 00100 # define WIN32_NO_STATUS 00101 # endif 00102 # include <windef.h> 00103 00104 #ifndef InterlockedIncrement 00105 _STLP_IMPORT_DECLSPEC LONG _STLP_STDCALL InterlockedIncrement(IN OUT LONG volatile *); 00106 _STLP_IMPORT_DECLSPEC LONG _STLP_STDCALL InterlockedDecrement(IN OUT LONG volatile *); 00107 _STLP_IMPORT_DECLSPEC LONG _STLP_STDCALL InterlockedExchange(IN OUT LONG volatile *, LONG); 00108 _STLP_IMPORT_DECLSPEC void _STLP_STDCALL Sleep(DWORD); 00109 #endif 00110 # if defined (_WIN64) 00111 _STLP_IMPORT_DECLSPEC void* _STLP_STDCALL _InterlockedExchangePointer(void* volatile *, void*); 00112 # endif 00113 # elif !defined (_STLP_WCE) 00114 /* boris : for the latest SDK, you may actually need the other version of the declaration (above) 00115 * even for earlier VC++ versions. There is no way to tell SDK versions apart, sorry ... 00116 */ 00117 _STLP_IMPORT_DECLSPEC long _STLP_STDCALL InterlockedIncrement(long volatile *); 00118 _STLP_IMPORT_DECLSPEC long _STLP_STDCALL InterlockedDecrement(long volatile *); 00119 _STLP_IMPORT_DECLSPEC long _STLP_STDCALL InterlockedExchange(long volatile *, long); 00120 # else 00121 /* start of eMbedded Visual C++ specific section */ 00122 # include <stl/config/_native_headers.h> 00123 00124 /* Don't let windef.h define its min and max macros. */ 00125 # if !defined (NOMINMAX) 00126 # define NOMINMAX 00127 # endif 00128 # include <windef.h> /* needed for basic windows types */ 00129 00132 # if (_WIN32_WCE >= 0x500) 00133 # define _STLP_NATIVE_SETJMP_H_INCLUDED 00134 # endif 00135 00136 # ifndef _WINBASE_ /* winbase.h already included? */ 00137 long WINAPI InterlockedIncrement(long*); 00138 long WINAPI InterlockedDecrement(long*); 00139 long WINAPI InterlockedExchange(long*, long); 00140 # endif 00141 00142 # ifndef __WINDOWS__ /* windows.h already included? */ 00143 00144 # if defined (x86) 00145 # include <winbase.h> /* needed for inline versions of Interlocked* functions */ 00146 # endif 00147 00148 # ifndef _MFC_VER 00149 00150 # define MessageBox MessageBoxW 00151 int WINAPI MessageBoxW(HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType); 00152 00153 # define wvsprintf wvsprintfW 00154 int WINAPI wvsprintfW(LPWSTR, LPCWSTR, va_list ArgList); 00155 00156 void WINAPI ExitThread(DWORD dwExitCode); 00157 00158 # if !defined (COREDLL) 00159 # define _STLP_WCE_WINBASEAPI DECLSPEC_IMPORT 00160 # else 00161 # define _STLP_WCE_WINBASEAPI 00162 # endif 00163 00164 _STLP_WCE_WINBASEAPI int WINAPI 00165 MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, 00166 int cbMultiByte, LPWSTR lpWideCharStr, int cchWideChar); 00167 00168 _STLP_WCE_WINBASEAPI UINT WINAPI GetACP(); 00169 00170 _STLP_WCE_WINBASEAPI BOOL WINAPI TerminateProcess(HANDLE hProcess, DWORD uExitCode); 00171 00172 # define OutputDebugString OutputDebugStringW 00173 void WINAPI OutputDebugStringW(LPCWSTR); 00174 00175 _STLP_WCE_WINBASEAPI void WINAPI Sleep(DWORD); 00176 00177 # undef _STLP_WCE_WINBASEAPI 00178 00179 # endif /* !_MFC_VER */ 00180 00181 # endif /* !__WINDOWS__ */ 00182 00183 /* end of eMbedded Visual C++ specific section */ 00184 # endif 00185 00186 # if !defined (_STLP_WCE) 00187 _STLP_IMPORT_DECLSPEC void _STLP_STDCALL OutputDebugStringA(const char* lpOutputString); 00188 # endif 00189 00190 # if defined (InterlockedIncrement) && defined(_MSC_VER) 00191 # pragma intrinsic(_InterlockedIncrement) 00192 # pragma intrinsic(_InterlockedDecrement) 00193 # pragma intrinsic(_InterlockedExchange) 00194 # if defined (_WIN64) 00195 # pragma intrinsic(_InterlockedExchangePointer) 00196 # endif 00197 # endif 00198 # if defined (__cplusplus) 00199 } /* extern "C" */ 00200 # endif 00201 00202 # endif 00203 00204 /* Here we use a macro different than the InterlockedExchangePointer SDK one 00205 * to avoid macro definition conflict. */ 00206 # if !defined (_WIN64) 00207 /* Under 32 bits platform we rely on a simple InterlockedExchange call. */ 00208 # if defined (__cplusplus) && defined(__BUILDING_STLPORT) 00209 /* We do not define this function if we are not in a C++ translation unit just 00210 * because of the 'inline' keyword portability issue it would introduce. We will 00211 * have to fix it the day we need this function for a C translation unit. 00212 */ 00213 inline 00214 void* _STLP_CALL STLPInterlockedExchangePointer(void* volatile* __a, void* __b) { 00215 # if defined (_STLP_MSVC) 00216 /* Here MSVC produces warning if 64 bits portability issue is activated. 00217 * MSVC do not see that _STLP_ATOMIC_EXCHANGE_PTR is a macro which content 00218 * is based on the platform, Win32 or Win64 00219 */ 00220 # pragma warning (push) 00221 # pragma warning (disable : 4311) // pointer truncation from void* to long 00222 # pragma warning (disable : 4312) // conversion from long to void* of greater size 00223 # endif 00224 # if !defined (_STLP_NO_NEW_STYLE_CASTS) 00225 return reinterpret_cast<void*>(InterlockedExchange(reinterpret_cast<long*>(const_cast<void**>(__a)), 00226 reinterpret_cast<long>(__b))); 00227 # else 00228 return (void*)InterlockedExchange((long*)__a, (long)__b); 00229 # endif 00230 # if defined (_STLP_MSVC) 00231 # pragma warning (pop) 00232 # endif 00233 } 00234 # endif 00235 # else 00236 # define STLPInterlockedExchangePointer _InterlockedExchangePointer 00237 # endif 00238 00239 #endif /* _STLP_WINDOWS_H_INCLUDED */ 00240 00241 /* _STLP_WIN95_LIKE signal the Windows 95 OS or assimilated Windows OS version that 00242 * has Interlockeded[Increment, Decrement] Win32 API functions not returning modified 00243 * value. 00244 */ 00245 #if (defined (WINVER) && (WINVER < 0x0410) && (!defined (_WIN32_WINNT) || (_WIN32_WINNT < 0x400))) || \ 00246 (!defined (WINVER) && (defined (_WIN32_WINDOWS) && (_WIN32_WINDOWS < 0x0410) || \ 00247 (defined (_WIN32_WINNT) && (_WIN32_WINNT < 0x400)))) 00248 # define _STLP_WIN95_LIKE 00249 #endif 00250 00251 /* Between Windows 95 (0x400) and later Windows OSes an API enhancement forces us 00252 * to change _Refcount_Base internal struct. As _Refcount_base member methods might 00253 * be partially inlined we need to check that STLport build/use are coherent. To do 00254 * so we try to generate a link time error thanks to the following macro. 00255 * This additional check is limited to old compilers that might still be used with 00256 * Windows 95. */ 00257 #if (defined (_DEBUG) || defined (_STLP_DEBUG)) && \ 00258 (defined (_STLP_MSVC) && (_STLP_MSVC < 1310) || \ 00259 defined (__GNUC__) && (__GNUC__ < 3)) 00260 /* We invert symbol names based on macro detection, when building for Windows 00261 * 95 we expose a 00262 * building_for_windows95_or_previous_but_library_built_for_windows98_or_later 00263 * function in order to have a more obvious link error message signaling how 00264 * the lib has been built and how it is used. */ 00265 # if defined (__BUILDING_STLPORT) 00266 # if defined (_STLP_WIN95_LIKE) 00267 # define _STLP_SIGNAL_RUNTIME_COMPATIBILITY building_for_windows95_but_library_built_for_at_least_windows98 00268 # else 00269 # define _STLP_SIGNAL_RUNTIME_COMPATIBILITY building_for_at_least_windows98_but_library_built_for_windows95 00270 # endif 00271 # else 00272 # if defined (_STLP_WIN95_LIKE) 00273 # define _STLP_CHECK_RUNTIME_COMPATIBILITY building_for_windows95_but_library_built_for_at_least_windows98 00274 # else 00275 # define _STLP_CHECK_RUNTIME_COMPATIBILITY building_for_at_least_windows98_but_library_built_for_windows95 00276 # endif 00277 # endif 00278 #endif 00279 00280 #if defined (__WIN16) || defined (WIN16) || defined (_WIN16) 00281 # define _STLP_WIN16 00282 #else 00283 # define _STLP_WIN32 00284 #endif 00285 00286 #if 0 00287 #if defined(_STLP_WIN32) 00288 # define _STLP_USE_WIN32_IO /* CreateFile/ReadFile/WriteFile */ 00289 #endif 00290 #endif 00291 00292 #if defined(__MINGW32__) && !defined(_STLP_USE_STDIO_IO) 00293 # define _STLP_USE_WIN32_IO /* CreateFile/ReadFile/WriteFile */ 00294 #endif /* __MINGW32__ */ 00295 00296 #ifdef _STLP_WIN16 00297 # define _STLP_USE_UNIX_EMULATION_IO /* _open/_read/_write */ 00298 # define _STLP_LDOUBLE_80 00299 #endif 00300 00301 #endif /* _STLP_INTERNAL_WINDOWS_H */ Generated on Sun May 27 2012 04:29:49 for ReactOS by
1.7.6.1
|