Go to the documentation of this file.
18 #ifndef __SPECKLEY_SYSTEM_DEP_H__
19 #define __SPECKLEY_SYSTEM_DEP_H__
21 #include <escript/DataTypes.h>
23 #define Speckley_DLL_API
26 # ifndef Speckley_STATIC_LIB
27 # undef Speckley_DLL_API
28 # ifdef Speckley_EXPORTS
29 # define Speckley_DLL_API __declspec(dllexport)
31 # define Speckley_DLL_API __declspec(dllimport)
39 #include <boost/detail/endian.hpp>
40 #ifdef ESYS_DEPRECATED_BOOST_ENDIAN
41 #include <boost/predef/other/endian.h>
47 #ifndef ESYS_DEPRECATED_BOOST_ENDIAN
49 #elif defined(ESYS_DEPRECATED_BOOST_ENDIAN) && defined(BOOST_ENDIAN_BIG_BYTE)
51 #elif defined(ESYS_DEPRECATED_BOOST_ENDIAN) && defined(BOOST_ENDIAN_LITTLE_BYTE)
53 #elif defined(ESYS_DEPRECATED_BOOST_ENDIAN) && defined(BOOST_ENDIAN_LITTLE_WORD)
73 unsigned long* v =
reinterpret_cast<unsigned long*
>(val);
74 *v = _byteswap_ulong(*v);
79 unsigned __int64* v =
reinterpret_cast<unsigned __int64*
>(val);
80 *v = _byteswap_uint64(*v);
90 # include <byteswap.h>
91 #elif HAVE_SYS_ENDIAN_H
92 # include <sys/endian.h>
94 # define bswap_32(D) bswap32((D))
97 # define bswap_64(D) bswap64((D))
99 #elif HAVE_OSBYTEORDER_H
100 # include <libkern/OSByteOrder.h>
101 # define bswap_32 OSSwapInt32
102 # define bswap_64 OSSwapInt64
103 #else // uh oh, we can't swap bytes...
104 # define bswap_32(D) (D)
105 # define bswap_64(D) (D)
106 #endif // header selection
111 unsigned int* v =
reinterpret_cast<unsigned int*
>(val);
118 uint64_t* v =
reinterpret_cast<uint64_t*
>(val);
127 #endif // __SPECKLEY_SYSTEM_DEP_H__
@ DATATYPE_INT32
Definition: speckley/src/system_dep.h:61
@ DATATYPE_FLOAT64
Definition: speckley/src/system_dep.h:63
@ BYTEORDER_NATIVE
Definition: speckley/src/system_dep.h:48
#define bswap_64(D)
Definition: speckley/src/system_dep.h:105
Definition: AbstractAssembler.cpp:19
char * byte_swap64(char *val)
Definition: speckley/src/system_dep.h:116
@ DATATYPE_FLOAT32
Definition: speckley/src/system_dep.h:62
#define bswap_32(D)
Definition: speckley/src/system_dep.h:104
@ BYTEORDER_LITTLE_ENDIAN
Definition: speckley/src/system_dep.h:56
@ BYTEORDER_BIG_ENDIAN
Definition: speckley/src/system_dep.h:57
char * byte_swap32(char *val)
Definition: speckley/src/system_dep.h:109