Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

win32.hpp

Go to the documentation of this file.
00001 //  (C) Copyright John Maddock 2001 - 2003. 
00002 //  (C) Copyright Bill Kempf 2001. 
00003 //  (C) Copyright Aleksey Gurtovoy 2003. 
00004 //  Use, modification and distribution are subject to the 
00005 //  Boost Software License, Version 1.0. (See accompanying file 
00006 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
00007 
00008 //  See http://www.boost.org for most recent version.
00009 
00010 //  Win32 specific config options:
00011 
00012 #define LIBSMBIOS_PLATFORM "Win32"
00013 #define LIBSMBIOS_PLATFORM_WIN32
00014 
00015 // Windows has a special platform-specific smbios table accessor method
00016 // that can be used if generic memory access fails.
00017 #define LIBSMBIOS_HAS_ARCH_TABLE_CLASS
00018 
00019 // Enable 64-bit file access (changes off_t to 64-bit)
00020 #define FSEEK(fh, pos, whence) fseek(fh, static_cast<long>(pos), whence)
00021 
00022 #if defined(__GNUC__) && !defined(LIBSMBIOS_NO_SWPRINTF)
00023 #  define LIBSMBIOS_NO_SWPRINTF
00024 #endif
00025 
00026 #if !defined(__GNUC__) && !defined(LIBSMBIOS_HAS_DECLSPEC)
00027 #  define LIBSMBIOS_HAS_DECLSPEC
00028 #endif
00029 
00030 #if defined(__MINGW32__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2)))
00031 #  define LIBSMBIOS_HAS_STDINT_H
00032 #  define __STDC_LIMIT_MACROS
00033 #endif
00034 
00035 //
00036 // Win32 will normally be using native Win32 threads,
00037 // but there is a pthread library avaliable as an option,
00038 // we used to disable this when LIBSMBIOS_DISABLE_WIN32 was 
00039 // defined but no longer - this should allow some
00040 // files to be compiled in strict mode - while maintaining
00041 // a consistent setting of LIBSMBIOS_HAS_THREADS across
00042 // all translation units (needed for shared_ptr etc).
00043 //
00044 #ifndef LIBSMBIOS_HAS_PTHREADS
00045 #  define LIBSMBIOS_HAS_WINTHREADS
00046 #endif
00047 
00048 #ifndef LIBSMBIOS_DISABLE_WIN32
00049 // WEK: Added
00050 #define LIBSMBIOS_HAS_FTIME
00051 
00052 #endif
00053 
00054 //
00055 // disable min/max macros:
00056 //
00057 #ifdef min
00058 #  undef min
00059 #endif
00060 #ifdef max
00061 #  undef max
00062 #endif
00063 #ifndef NOMINMAX
00064 #  define NOMINMAX
00065 #endif
00066 
00067 #ifdef LIBSMBIOS_MSVC
00068 #include <algorithm> // for existing std::min and std::max
00069 namespace std{
00070   // Apparently, something in the Microsoft libraries requires the "long"
00071   // overload, because it calls the min/max functions with arguments of
00072   // slightly different type.  (If this proves to be incorrect, this
00073   // whole "LIBSMBIOS_MSVC" section can be removed.)
00074   inline long min(long __a, long __b) {
00075     return __b < __a ? __b : __a;
00076   }
00077   inline long max(long __a, long __b) {
00078     return  __a < __b ? __b : __a;
00079   }
00080   // The "long double" overload is required, otherwise user code calling
00081   // min/max for floating-point numbers will use the "long" overload.
00082   // (SourceForge bug #495495)
00083   inline long double min(long double __a, long double __b) {
00084     return __b < __a ? __b : __a;
00085   }
00086   inline long double max(long double __a, long double __b) {
00087     return  __a < __b ? __b : __a;
00088   }
00089 }
00090 using std::min;
00091 using std::max;
00092 #     endif
00093 
00094 

Generated on Wed Apr 11 16:25:10 2007 for SMBIOS Library by doxygen 1.3.5