129
129
#define NEVER_INLINE
133
* Disable __attribute__ for non GNU compilers, since we're using them
134
* only to either generate or suppress warnings.
136
#ifndef __attribute__
137
# if !defined(__GNUC__)
138
# define __attribute__(A)
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"
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>
218
238
#include <stdio.h>
262
282
#include <errno.h> /* Recommended by debian */
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>
273
284
#if defined(HAVE_STDBOOL_H)
274
285
#include <stdbool.h>
288
#ifdef HAVE_SYS_STAT_H
289
# include <sys/stat.h>
279
293
A lot of our programs uses asserts, so better to always include it
837
849
((uchar*) &def_temp)[7]=(M)[0];\
838
850
(V) = def_temp; } while(0)
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))
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)
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))
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))
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))
937
949
#endif /* WORDS_BIGENDIAN */