From b4ad77840eb8e8a90f64bc41d43ec97a369234e2 Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Thu, 25 Feb 2016 09:28:25 -0600 Subject: [PATCH] Split test sims and fun sims into separate directories New trickcomm test sim was not compiling on the Mac because of linux only define. refs #191 --- test/SIM_trickcomm/S_overrides.mk | 2 +- test/SIM_trickcomm/tc_server.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/test/SIM_trickcomm/S_overrides.mk b/test/SIM_trickcomm/S_overrides.mk index ea51c23e..4399a7d5 100644 --- a/test/SIM_trickcomm/S_overrides.mk +++ b/test/SIM_trickcomm/S_overrides.mk @@ -4,7 +4,7 @@ TRICK_CXXFLAGS += -I. S_main: tc_server tc_server: tc_server.c - ${TRICK_CC} ${TRICK_CFLAGS} ${TRICK_SYSTEM_CFLAGS} -I${TRICK_HOME}/trick_source -o $@ $< -L${TRICK_LIB_DIR} -ltrick_comm ${TRICK_EXEC_LINK_LIBS} + ${TRICK_CC} -o $@ $< clean: clean_tc_apps spotless: clean_tc_apps diff --git a/test/SIM_trickcomm/tc_server.c b/test/SIM_trickcomm/tc_server.c index 90f1cebd..bb83f6f7 100644 --- a/test/SIM_trickcomm/tc_server.c +++ b/test/SIM_trickcomm/tc_server.c @@ -7,6 +7,12 @@ #include "test_struct.h" +#if (__linux) +# define TC_NOSIGNAL MSG_NOSIGNAL +#else +# define TC_NOSIGNAL 0 +#endif + int main () { int nbytes ; TEST_DATA_STRUCT tds ; @@ -34,12 +40,12 @@ int main () { nbytes = 1 ; while( nbytes > 0 ) { nbytes = recvfrom(connection, &tds, sizeof(TEST_DATA_STRUCT), - MSG_NOSIGNAL, (struct sockaddr *) &cliAddr, &cliLen) ; + TC_NOSIGNAL, (struct sockaddr *) &cliAddr, &cliLen) ; fprintf(stderr, "nbytes = %d\n", nbytes ) ; fprintf(stderr, "tc_server int1 =%x int2 =%x\n", tds.int1 , tds.int2 ) ; fprintf(stderr, "tc_server long1=%lx long2=%lx\n", tds.long1 , tds.long2 ) ; if ( nbytes == sizeof(TEST_DATA_STRUCT)) { - sendto(connection, &tds, sizeof(TEST_DATA_STRUCT), MSG_NOSIGNAL, + sendto(connection, &tds, sizeof(TEST_DATA_STRUCT), TC_NOSIGNAL, (struct sockaddr *) &remoteServAddr, (socklen_t) sizeof(struct sockaddr_in)) ; }