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

win64.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 // workaround for broken namespace on win64 compiler
00036 #define LIBSMBIOS_NO_STDC_NAMESPACE
00037 
00038 //
00039 // Win32 will normally be using native Win32 threads,
00040 // but there is a pthread library avaliable as an option,
00041 // we used to disable this when LIBSMBIOS_DISABLE_WIN32 was 
00042 // defined but no longer - this should allow some
00043 // files to be compiled in strict mode - while maintaining
00044 // a consistent setting of LIBSMBIOS_HAS_THREADS across
00045 // all translation units (needed for shared_ptr etc).
00046 //
00047 #ifndef LIBSMBIOS_HAS_PTHREADS
00048 #  define LIBSMBIOS_HAS_WINTHREADS
00049 #endif
00050 
00051 #ifndef LIBSMBIOS_DISABLE_WIN32
00052 // WEK: Added
00053 #define LIBSMBIOS_HAS_FTIME
00054 
00055 #endif
00056 
00057 //
00058 // disable min/max macros:
00059 //
00060 #ifdef min
00061 #  undef min
00062 #endif
00063 #ifdef max
00064 #  undef max
00065 #endif
00066 #ifndef NOMINMAX
00067 #  define NOMINMAX
00068 #endif
00069 
00070 #ifdef LIBSMBIOS_MSVC
00071 #include <algorithm> // for existing std::min and std::max
00072 namespace std{
00073   // Apparently, something in the Microsoft libraries requires the "long"
00074   // overload, because it calls the min/max functions with arguments of
00075   // slightly different type.  (If this proves to be incorrect, this
00076   // whole "LIBSMBIOS_MSVC" section can be removed.)
00077   inline long min(long __a, long __b) {
00078     return __b < __a ? __b : __a;
00079   }
00080   inline long max(long __a, long __b) {
00081     return  __a < __b ? __b : __a;
00082   }
00083   // The "long double" overload is required, otherwise user code calling
00084   // min/max for floating-point numbers will use the "long" overload.
00085   // (SourceForge bug #495495)
00086   inline long double min(long double __a, long double __b) {
00087     return __b < __a ? __b : __a;
00088   }
00089   inline long double max(long double __a, long double __b) {
00090     return  __a < __b ? __b : __a;
00091   }
00092 }
00093 using std::min;
00094 using std::max;
00095 #     endif
00096 
00097 

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