glibconfig.h

Go to the documentation of this file.
00001 /* glibconfig.h.win32 */
00002 /* Handcrafted for Microsoft C and gcc -mno-cygwin ("mingw32"). */
00003 
00004 #ifndef __G_LIBCONFIG_H__
00005 #define __G_LIBCONFIG_H__
00006 
00007 #include <gmacros.h>
00008 
00009 #ifdef _MSC_VER
00010 /* Make MSVC more pedantic, this is a recommended pragma list
00011  * from _Win32_Programming_ by Rector and Newcomer.
00012  */
00013 
00014 #pragma warning(error:4002)
00015 #pragma warning(error:4003)
00016 #pragma warning(1:4010)
00017 #pragma warning(error:4013)
00018 #pragma warning(1:4016)
00019 #pragma warning(error:4020)
00020 #pragma warning(error:4021)
00021 #pragma warning(error:4027)
00022 #pragma warning(error:4029)
00023 #pragma warning(error:4033)
00024 #pragma warning(error:4035)
00025 #pragma warning(error:4045)
00026 #pragma warning(error:4047)
00027 #pragma warning(error:4049)
00028 #pragma warning(error:4053)
00029 #pragma warning(error:4071)
00030 #pragma warning(disable:4101)
00031 #pragma warning(error:4150)
00032 
00033 #pragma warning(disable:4244)   // No possible loss of data warnings
00034 #pragma warning(disable:4305)   // No truncation from int to char warnings
00035 
00036 #endif /* _MSC_VER */
00037 
00038 #include <limits.h>
00039 #include <float.h>
00040 
00041 #define G_MINFLOAT      FLT_MIN
00042 #define G_MAXFLOAT      FLT_MAX
00043 #define G_MINDOUBLE     DBL_MIN
00044 #define G_MAXDOUBLE     DBL_MAX
00045 #define G_MINSHORT      SHRT_MIN
00046 #define G_MAXSHORT      SHRT_MAX
00047 #define G_MAXUSHORT     USHRT_MAX
00048 #define G_MININT        INT_MIN
00049 #define G_MAXINT        INT_MAX
00050 #define G_MAXUINT       UINT_MAX
00051 #define G_MINLONG       LONG_MIN
00052 #define G_MAXLONG       LONG_MAX
00053 #define G_MAXULONG      ULONG_MAX
00054 
00055 G_BEGIN_DECLS
00056 
00057 typedef signed char gint8;
00058 typedef unsigned char guint8;
00059 typedef signed short gint16;
00060 typedef unsigned short guint16;
00061 #define G_GINT16_FORMAT "hi"
00062 #define G_GUINT16_FORMAT "hu"
00063 typedef signed int gint32;
00064 typedef unsigned int guint32;
00065 #define G_GINT32_FORMAT "i"
00066 #define G_GUINT32_FORMAT "u"
00067 
00068 #define G_HAVE_GINT64 1
00069 
00070 /* These are compiler specific */
00071 #ifdef _MSC_VER
00072 typedef __int64 gint64;
00073 typedef unsigned __int64 guint64;
00074 #define G_GINT64_CONSTANT(val)  (val##i64)
00075 #elif __GNUC__
00076 typedef long long gint64;
00077 typedef unsigned long long guint64;
00078 #define G_GINT64_CONSTANT(val)  (val##LL)
00079 #endif
00080 
00081 /* These depend on the C library. Using this file means the we
00082  * use the (bundled) Microsoft msvcrt.dll.
00083  */
00084 #define G_GINT64_FORMAT "I64i"
00085 #define G_GUINT64_FORMAT "I64u"
00086 
00087 typedef gint32 gssize;
00088 typedef guint32 gsize;
00089 
00090 #define GPOINTER_TO_INT(p)      ((gint)(p))
00091 #define GPOINTER_TO_UINT(p)     ((guint)(p))
00092 
00093 #define GINT_TO_POINTER(i)      ((gpointer)(i))
00094 #define GUINT_TO_POINTER(u)     ((gpointer)(u))
00095 
00096 #define g_ATEXIT(proc)  (atexit (proc))
00097 
00098 #define g_memmove(d,s,n) G_STMT_START { memmove ((d), (s), (n)); } G_STMT_END
00099 
00100 #define GLIB_MAJOR_VERSION 1
00101 #define GLIB_MINOR_VERSION 3
00102 #define GLIB_MICRO_VERSION 2
00103 
00104 #define G_OS_WIN32
00105 
00106 #ifdef  __cplusplus
00107 #define G_HAVE_INLINE   1
00108 #else   /* !__cplusplus */
00109 #define G_HAVE___INLINE 1
00110 #endif
00111 
00112 #define G_THREADS_ENABLED
00113 /*
00114  * The following program can be used to determine the magic values below:
00115  * #include <stdio.h>
00116  * #include <pthread.h>
00117  * main(int argc, char **argv)
00118  * {
00119  *   int i;
00120  *   pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
00121  *   printf ("sizeof (pthread_mutex_t) = %d\n", sizeof (pthread_mutex_t));
00122  *   printf ("sizeof (pthread_t) = %d\n", sizeof (pthread_t));
00123  *   printf ("PTHREAD_MUTEX_INITIALIZER = ");
00124  *   for (i = 0; i < sizeof (pthread_mutex_t); i++)
00125  *     printf ("%u, ", ((unsigned char *) &m)[i]);
00126  *   printf ("\n");
00127  *   exit(0);
00128  * }
00129  */
00130 
00131 #define G_THREADS_IMPL_POSIX
00132 typedef struct _GStaticMutex GStaticMutex;
00133 struct _GStaticMutex
00134 {
00135   struct _GMutex *runtime_mutex;
00136   union {
00137     /* The size of the pad array should be sizeof (pthread_mutex_t) */
00138     /* This value corresponds to the 1999-05-30 version of pthreads-win32 */
00139     char   pad[4];
00140     double dummy_double;
00141     void  *dummy_pointer;
00142     long   dummy_long;
00143   } aligned_pad_u;
00144 };
00145 /* This should be NULL followed by the bytes in PTHREAD_MUTEX_INITIALIZER */
00146 #define G_STATIC_MUTEX_INIT     { NULL, { { 255, 255, 255, 255 } } }
00147 #define g_static_mutex_get_mutex(mutex) \
00148   (g_thread_use_default_impl ? ((GMutex*) &((mutex)->aligned_pad_u)) : \
00149    g_static_mutex_get_mutex_impl (&((mutex)->runtime_mutex)))
00150 /* This represents a system thread as used by the implementation. An
00151  * alien implementaion, as loaded by g_thread_init can only count on
00152  * "sizeof (gpointer)" bytes to store their info. We however need more
00153  * for some of our native implementations. */
00154 typedef union _GSystemThread GSystemThread;
00155 union _GSystemThread
00156 {
00157   /* The size of the data array should be sizeof (pthread_t) */
00158   /* This value corresponds to the 1999-05-30 version of pthreads-win32 */
00159   char   data[4];
00160   double dummy_double;
00161   void  *dummy_pointer;
00162   long   dummy_long;
00163 };
00164 
00165 #define GINT16_TO_LE(val)       ((gint16) (val))
00166 #define GUINT16_TO_LE(val)      ((guint16) (val))
00167 #define GINT16_TO_BE(val)       ((gint16) GUINT16_SWAP_LE_BE (val))
00168 #define GUINT16_TO_BE(val)      (GUINT16_SWAP_LE_BE (val))
00169 
00170 #define GINT32_TO_LE(val)       ((gint32) (val))
00171 #define GUINT32_TO_LE(val)      ((guint32) (val))
00172 #define GINT32_TO_BE(val)       ((gint32) GUINT32_SWAP_LE_BE (val))
00173 #define GUINT32_TO_BE(val)      (GUINT32_SWAP_LE_BE (val))
00174 
00175 #define GINT64_TO_LE(val)       ((gint64) (val))
00176 #define GUINT64_TO_LE(val)      ((guint64) (val))
00177 #define GINT64_TO_BE(val)       ((gint64) GUINT64_SWAP_LE_BE (val))
00178 #define GUINT64_TO_BE(val)      (GUINT64_SWAP_LE_BE (val))
00179 
00180 #define GLONG_TO_LE(val)        ((glong) GINT32_TO_LE (val))
00181 #define GULONG_TO_LE(val)       ((gulong) GUINT32_TO_LE (val))
00182 #define GLONG_TO_BE(val)        ((glong) GINT32_TO_BE (val))
00183 #define GULONG_TO_BE(val)       ((gulong) GUINT32_TO_BE (val))
00184 
00185 #define GINT_TO_LE(val)         ((gint) GINT32_TO_LE (val))
00186 #define GUINT_TO_LE(val)        ((guint) GUINT32_TO_LE (val))
00187 #define GINT_TO_BE(val)         ((gint) GINT32_TO_BE (val))
00188 #define GUINT_TO_BE(val)        ((guint) GUINT32_TO_BE (val))
00189 #define G_BYTE_ORDER G_LITTLE_ENDIAN
00190 
00191 #define GLIB_SYSDEF_POLLIN      = 1
00192 #define GLIB_SYSDEF_POLLOUT     = 4
00193 #define GLIB_SYSDEF_POLLPRI     = 2
00194 #define GLIB_SYSDEF_POLLERR     = 8
00195 #define GLIB_SYSDEF_POLLHUP     = 16
00196 #define GLIB_SYSDEF_POLLNVAL    = 32
00197 
00198 #define G_MODULE_SUFFIX "dll"
00199 
00200 G_END_DECLS
00201 
00202 #endif /* __G_LIBCONFIG_H__ */

Generated on Tue Jul 5 14:14:41 2011 for ROOT_528-00b_version by  doxygen 1.5.1