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

linux.hpp

Go to the documentation of this file.
00001 //  (C) Copyright John Maddock 2001 - 2003. 
00002 //  (C) Copyright Jens Maurer 2001 - 2003. 
00003 //  Use, modification and distribution are subject to the 
00004 //  Boost Software License, Version 1.0. (See accompanying file 
00005 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
00006 
00007 //  See http://www.boost.org for most recent version.
00008 
00009 //  linux specific config options:
00010 
00011 #define LIBSMBIOS_PLATFORM "linux"
00012 #define LIBSMBIOS_PLATFORM_LINUX
00013 
00014 // don't want to enable this just yet.
00015 // // we can assume gettext on linux
00016 // #define LIBSMBIOS_HAS_GETTEXT
00017 
00018 // make sure we have __GLIBC_PREREQ if available at all
00019 #include <cstdlib>
00020 
00021 // If we are on IA64 we will need to macro define inb_p and outb_p
00022 #if defined(__ia64__)
00023 #    define outb_p outb
00024 #    define inb_p  inb
00025 #endif
00026 
00027 // Enable 64-bit file access 
00028 #define FSEEK(fh, pos, whence) fseeko(fh, static_cast<off_t>(pos), whence)
00029 
00030 //
00031 // <stdint.h> added to glibc 2.1.1
00032 // We can only test for 2.1 though:
00033 //
00034 #if defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1)))
00035    // <stdint.h> defines int64_t unconditionally, but <sys/types.h> defines
00036    // int64_t only if __GNUC__.  Thus, assume a fully usable <stdint.h>
00037    // only when using GCC.
00038 #  if defined __GNUC__
00039 #    define LIBSMBIOS_HAS_STDINT_H
00040 #  endif
00041 #endif
00042 
00043 #if defined(__LIBCOMO__)
00044    //
00045    // como on linux doesn't have std:: c functions:
00046    // NOTE: versions of libcomo prior to beta28 have octal version numbering,
00047    // e.g. version 25 is 21 (dec)
00048    //
00049 #  if __LIBCOMO_VERSION__ <= 20
00050 #    define LIBSMBIOS_NO_STDC_NAMESPACE
00051 #  endif
00052 
00053 #  if __LIBCOMO_VERSION__ <= 21
00054 #    define LIBSMBIOS_NO_SWPRINTF
00055 #  endif
00056 
00057 #endif
00058 
00059 //
00060 // If glibc is past version 2 then we definitely have
00061 // gettimeofday, earlier versions may or may not have it:
00062 //
00063 #if defined(__GLIBC__) && (__GLIBC__ >= 2)
00064 #  define LIBSMBIOS_HAS_GETTIMEOFDAY
00065 #endif
00066 
00067 #ifdef __USE_POSIX199309
00068 #  define LIBSMBIOS_HAS_NANOSLEEP
00069 #endif
00070 
00071 #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
00072 // __GLIBC_PREREQ is available since 2.1.2
00073 
00074    // swprintf is available since glibc 2.2.0
00075 #  if !__GLIBC_PREREQ(2,2) || (!defined(__USE_ISOC99) && !defined(__USE_UNIX98))
00076 #    define LIBSMBIOS_NO_SWPRINTF
00077 #  endif
00078 #else
00079 #  define LIBSMBIOS_NO_SWPRINTF
00080 #endif
00081 
00082 // boilerplate code:
00083 #define LIBSMBIOS_HAS_UNISTD_H
00084 #include <smbios/config/posix_features.hpp>
00085 
00086 #ifndef __GNUC__
00087 //
00088 // if the compiler is not gcc we still need to be able to parse
00089 // the GNU system headers, some of which (mainly <stdint.h>)
00090 // use GNU specific extensions:
00091 //
00092 #  ifndef __extension__
00093 #     define __extension__
00094 #  endif
00095 #  ifndef __const__
00096 #     define __const__ const
00097 #  endif
00098 #  ifndef __volatile__
00099 #     define __volatile__ volatile
00100 #  endif
00101 #  ifndef __signed__
00102 #     define __signed__ signed
00103 #  endif
00104 #  ifndef __typeof__
00105 #     define __typeof__ typeof
00106 #  endif
00107 #  ifndef __inline__
00108 #     define __inline__ inline
00109 #  endif
00110 #endif
00111 
00112 

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