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__
Definition: speckley/src/system_dep.h:60
Definition: speckley/src/system_dep.h:62
Definition: speckley/src/system_dep.h:47
#define bswap_64(D)
Definition: speckley/src/system_dep.h:104
Definition: AbstractAssembler.cpp:18
char * byte_swap64(char *val)
Definition: speckley/src/system_dep.h:115
Definition: speckley/src/system_dep.h:61
#define bswap_32(D)
Definition: speckley/src/system_dep.h:103
Definition: speckley/src/system_dep.h:55
Definition: speckley/src/system_dep.h:56
char * byte_swap32(char *val)
Definition: speckley/src/system_dep.h:108