~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/global.h

Giant merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
#define C_MODE_END
51
51
#endif
52
52
 
53
 
#include <config.h>
 
53
#include "config.h"
54
54
#if defined(__cplusplus) && defined(inline)
55
55
#undef inline                           /* fix configure problem */
56
56
#endif
129
129
#define NEVER_INLINE
130
130
#endif
131
131
 
 
132
/*
 
133
 *   Disable __attribute__ for non GNU compilers, since we're using them
 
134
 *     only to either generate or suppress warnings.
 
135
 *     */
 
136
#ifndef __attribute__
 
137
# if !defined(__GNUC__)
 
138
#  define __attribute__(A)
 
139
# endif
 
140
#endif
 
141
 
132
142
 
133
143
/* Fix problem with S_ISLNK() on Linux */
134
144
#if defined(TARGET_OS_LINUX) || defined(__GLIBC__)
214
224
#error "Please add -fno-exceptions to CXXFLAGS and reconfigure/recompile"
215
225
#endif
216
226
 
 
227
#if defined(HAVE_STDINT_H)
 
228
/* Need to include this _before_ stdlib, so that all defines are right */
 
229
/* We are mixing C and C++, so we wan the C limit macros in the C++ too */
 
230
/* Enable some extra C99 extensions */
 
231
#define __STDC_LIMIT_MACROS
 
232
#define __STDC_FORMAT_MACROS
 
233
#include <inttypes.h>
 
234
#include <stdint.h>
 
235
#endif
 
236
 
217
237
#ifndef stdin
218
238
#include <stdio.h>
219
239
#endif
261
281
 
262
282
#include <errno.h>                              /* Recommended by debian */
263
283
 
264
 
#if defined(HAVE_STDINT_H)
265
 
/* We are mixing C and C++, so we wan the C limit macros in the C++ too */
266
 
/* Enable some extra C99 extensions */
267
 
#define __STDC_LIMIT_MACROS
268
 
#define __STDC_FORMAT_MACROS
269
 
#include <inttypes.h>
270
 
#include <stdint.h>
271
 
#endif
272
 
 
273
284
#if defined(HAVE_STDBOOL_H)
274
285
#include <stdbool.h>
275
286
#endif
276
287
 
 
288
#ifdef HAVE_SYS_STAT_H
 
289
# include <sys/stat.h>
 
290
#endif
277
291
 
278
292
/*
279
293
  A lot of our programs uses asserts, so better to always include it
356
370
#define my_const_cast(A) (A)
357
371
#endif
358
372
 
359
 
#include <my_attribute.h>
360
 
 
361
373
/* From old s-system.h */
362
374
 
363
375
/*
837
849
                              ((uchar*) &def_temp)[7]=(M)[0];\
838
850
                              (V) = def_temp; } while(0)
839
851
#else
840
 
#define float4get(V,M)   memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(float))
841
 
#define float4store(V,M) memcpy_fixed((uchar*) V,(uchar*) (&M),sizeof(float))
 
852
#define float4get(V,M)   memcpy((uchar*) &V,(uchar*) (M),sizeof(float))
 
853
#define float4store(V,M) memcpy((uchar*) V,(uchar*) (&M),sizeof(float))
842
854
 
843
855
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
844
856
#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((uchar *) &V)[4];\
908
920
                             *(((char*)T)+1)=(((A) >> 16));\
909
921
                             *(((char*)T)+0)=(((A) >> 24)); } while(0)
910
922
 
911
 
#define floatget(V,M)    memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(float))
912
 
#define floatstore(T,V)  memcpy_fixed((uchar*) (T),(uchar*)(&V),sizeof(float))
913
 
#define doubleget(V,M)   memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(double))
914
 
#define doublestore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(double))
915
 
#define int64_tget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(uint64_t))
916
 
#define int64_tstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(uint64_t))
 
923
#define floatget(V,M)     memcpy((uchar*) &V,(uchar*) (M), sizeof(float))
 
924
#define floatstore(T,V)   memcpy((uchar*) (T),(uchar*)(&V), sizeof(float))
 
925
#define doubleget(V,M)    memcpy((uchar*) &V,(uchar*) (M), sizeof(double))
 
926
#define doublestore(T,V)  memcpy((uchar*) (T),(uchar*) &V, sizeof(double))
 
927
#define int64_tget(V,M)   memcpy((uchar*) &V,(uchar*) (M), sizeof(uint64_t))
 
928
#define int64_tstore(T,V) memcpy((uchar*) (T),(uchar*) &V, sizeof(uint64_t))
917
929
 
918
930
#else
919
931
 
924
936
#define shortstore(T,V) int2store(T,V)
925
937
#define longstore(T,V)  int4store(T,V)
926
938
#ifndef floatstore
927
 
#define floatstore(T,V)  memcpy_fixed((uchar*) (T),(uchar*) (&V),sizeof(float))
928
 
#define floatget(V,M)    memcpy_fixed((uchar*) &V, (uchar*) (M), sizeof(float))
 
939
#define floatstore(T,V)   memcpy((uchar*) (T),(uchar*) (&V),sizeof(float))
 
940
#define floatget(V,M)     memcpy((uchar*) &V, (uchar*) (M), sizeof(float))
929
941
#endif
930
942
#ifndef doubleget
931
 
#define doubleget(V,M)   memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(double))
932
 
#define doublestore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(double))
 
943
#define doubleget(V,M)    memcpy((uchar*) &V,(uchar*) (M),sizeof(double))
 
944
#define doublestore(T,V)  memcpy((uchar*) (T),(uchar*) &V,sizeof(double))
933
945
#endif /* doubleget */
934
 
#define int64_tget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(uint64_t))
935
 
#define int64_tstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(uint64_t))
 
946
#define int64_tget(V,M)   memcpy((uchar*) &V,(uchar*) (M),sizeof(uint64_t))
 
947
#define int64_tstore(T,V) memcpy((uchar*) (T),(uchar*) &V,sizeof(uint64_t))
936
948
 
937
949
#endif /* WORDS_BIGENDIAN */
938
950
 
981
993
#define NEED_EXPLICIT_SYNC_DIR 1
982
994
#endif
983
995
 
984
 
#include "gettext.h"
 
996
#include <libdrizzle/gettext.h>
985
997
 
986
998
#endif /* my_global_h */