summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShih-wei Liao <sliao@google.com>2012-02-05 18:04:46 -0800
committerShih-wei Liao <sliao@google.com>2012-02-05 19:39:43 -0800
commitef09ef41ce1e43f76d391c32c1ea0985a2d2db7f (patch)
tree3a6e9c6eebe945e52ac5529b4ef1e39cadb01e88
parent94b9d6eee6d1292afe990843c2cc99c98022f3ac (diff)
downloadgdk-ef09ef41ce1e43f76d391c32c1ea0985a2d2db7f.tar.gz
Socket code is built using native headers
Change-Id: I030cc9639a3148cfed14373465be3483ccf54c32 Author: Chris Dearman <chris@mips.com>
-rw-r--r--libportable/arch-mips/socket.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libportable/arch-mips/socket.c b/libportable/arch-mips/socket.c
index 85daadc..fc0e4fd 100644
--- a/libportable/arch-mips/socket.c
+++ b/libportable/arch-mips/socket.c
@@ -2,14 +2,18 @@
#include <sys/socket.h>
#include <sys/linux-syscalls.h>
-#if SOCK_STREAM==1
+#define SOCK_STREAM_PORTABLE 1
+#define SOCK_DGRAM_PORTABLE 2
+
+#if SOCK_STREAM==SOCK_STREAM_PORTABLE
#error Bad build environment
#endif
-static inline int mips_change_type(int type) {
+static inline int mips_change_type(int type)
+{
switch (type) {
- case SOCK_DGRAM: return 2;
- case SOCK_STREAM: return 1;
+ case SOCK_DGRAM_PORTABLE: return SOCK_DGRAM;
+ case SOCK_STREAM_PORTABLE: return SOCK_STREAM;
}
return type;
}