From: sdhsdh Date: Fri, 20 Nov 2009 06:04:24 +0000 (+0000) Subject: fix compile on OSX 10.6 X-Git-Tag: rc_6_tinyos_2_1_1~134 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=16b4884bf03fb4e9ff72bc2879ff262b716da334 fix compile on OSX 10.6 --- diff --git a/support/sdk/c/sf/Makefile.am b/support/sdk/c/sf/Makefile.am index b26b8059..3110210c 100644 --- a/support/sdk/c/sf/Makefile.am +++ b/support/sdk/c/sf/Makefile.am @@ -1,5 +1,7 @@ AUTOMAKE_OPTIONS = foreign +CFLAGS = -D_POSIX_C_SOURCE + TOS=$(shell ncc -print-tosdir) SERIAL_H = $(TOS)/lib/serial/Serial.h @@ -34,7 +36,7 @@ libmote_a_SOURCES = \ sfsource.c serialpacket.c serialpacket.h: $(SERIAL_H) - mig -o serialpacket.h -c-prefix=spacket c $(SERIAL_H) serial_packet + mig -o serialpacket.h -c-prefix=spacket c $(SERIAL_H) serial_packet $(CFLAGS) serialprotocol.h: $(SERIAL_H) - ncg -o $@ -c-prefix=SERIAL c $(SERIAL_H) Serial.h + ncg -o $@ -c-prefix=SERIAL c $(SERIAL_H) Serial.h $(CFLAGS) diff --git a/support/sdk/c/sf/sf.c b/support/sdk/c/sf/sf.c index ada9bc5b..f26fe810 100644 --- a/support/sdk/c/sf/sf.c +++ b/support/sdk/c/sf/sf.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include diff --git a/support/sdk/c/sf/sfsource.c b/support/sdk/c/sf/sfsource.c index 24df9603..ecde05c6 100644 --- a/support/sdk/c/sf/sfsource.c +++ b/support/sdk/c/sf/sfsource.c @@ -70,7 +70,7 @@ int open_sf_source(const char *host, int port) } addr.sin_family = entry->h_addrtype; - memcpy(&addr.sin_addr, entry->h_addr, entry->h_length); + memcpy(&addr.sin_addr, entry->h_addr_list[0], entry->h_length); addr.sin_port = htons(port); if (connect(fd, (struct sockaddr *)&addr, sizeof addr) < 0) {