Skip to content

Commit e5598e8

Browse files
committed
Use system defines for Apple and Windows
1 parent 0358aa3 commit e5598e8

4 files changed

Lines changed: 14 additions & 8 deletions

File tree

framework/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,6 @@ STREAM_LINK_LIBRARY(Stream
125125
nx/Processor.cxx
126126
)
127127

128-
if(APPLE)
129-
target_compile_definitions(Stream PUBLIC STREAM_AARCH64)
130-
elseif(MSVC)
131-
target_compile_definitions(Stream PUBLIC STREAM_WINDOWS)
132-
endif()
133-
134128
foreach(dir base dogma get4 hadaq mbs nx)
135129
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/${dir}
136130
DESTINATION ${STREAM_INSTALL_INCLUDEDIR})

framework/hadaq/TrbProcessor.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include "dogma/defines.h"
1515

16-
#ifdef STREAM_WINDOWS
16+
#ifdef __WINDOWS__
1717
#define RAWPRINT()
1818
#else
1919
#define RAWPRINT( args ... ) if(IsPrintRawData()) printf( args )

include/base/Profiler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace base {
2323
clock_t GetClock()
2424
{
2525

26-
#ifdef STREAM_AARCH64
26+
#if defined(__MACH__)
2727
uint64_t virtual_timer_value;
2828
asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value));
2929
return virtual_timer_value;

include/dogma/tdc5.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@
88
#define be16toh(x) OSSwapBigToHostInt16(x)
99
#define be32toh(x) OSSwapBigToHostInt32(x)
1010
#define be64toh(x) OSSwapBigToHostInt64(x)
11+
#elif defined(__WINDOWS__) /* Windows section */
12+
#include <winsock2.h>
13+
#include <sys/param.h>
14+
#if BYTE_ORDER == LITTLE_ENDIAN
15+
#define be16toh(x) ntohs(x)
16+
#define be32toh(x) ntohl(x)
17+
#define be64toh(x) ntohll(x)
18+
#else
19+
#define be16toh(x) (x)
20+
#define be32toh(x) (x)
21+
#define be64toh(x) (x)
22+
#endif
1123
#else
1224
#include <endian.h>
1325
#endif

0 commit comments

Comments
 (0)