diff options
author | Shih-wei Liao <sliao@google.com> | 2012-02-05 17:19:24 -0800 |
---|---|---|
committer | Shih-wei Liao <sliao@google.com> | 2012-02-05 17:19:37 -0800 |
commit | 94b9d6eee6d1292afe990843c2cc99c98022f3ac (patch) | |
tree | b2199f9fcbf00b5e5f7f48874840d72afad936ea | |
parent | 4c05150d77225cd8be862b006c421d8c045fa71c (diff) | |
download | gdk-94b9d6eee6d1292afe990843c2cc99c98022f3ac.tar.gz |
Add build checks to ensure the code is being built with MIPS headers
Change-Id: I52185d0ba81baa2380740491e6695ea99da795e1
Author: Chris Dearman <chris@mips.com>
-rw-r--r-- | libportable/arch-mips/mmap.c | 4 | ||||
-rw-r--r-- | libportable/arch-mips/open.c | 4 | ||||
-rw-r--r-- | libportable/arch-mips/socket.c | 4 |
3 files changed, 12 insertions, 0 deletions
diff --git a/libportable/arch-mips/mmap.c b/libportable/arch-mips/mmap.c index ab444c9..e772a7c 100644 --- a/libportable/arch-mips/mmap.c +++ b/libportable/arch-mips/mmap.c @@ -9,6 +9,10 @@ extern void* __mmap2(void*, size_t, int, int, int, size_t); +#if MAP_ANONYMOUS_PORTABLE==MAP_ANONYMOUS +#error Bad build environment +#endif + static inline int mips_change_prot(int prot) { if (prot & PROT_SEM_PORTABLE) { prot &= ~PROT_SEM_PORTABLE; diff --git a/libportable/arch-mips/open.c b/libportable/arch-mips/open.c index e8b6c1f..6dd5a8c 100644 --- a/libportable/arch-mips/open.c +++ b/libportable/arch-mips/open.c @@ -5,6 +5,10 @@ extern int __open(const char*, int, int); #define O_CREAT_PORTABLE 00000100 +#if O_CREAT_PORTABLE==O_CREAT +#error Bad build environment +#endif + static inline int mips_change_flags(int flags) { if (flags & O_CREAT_PORTABLE) { flags &= ~O_CREAT_PORTABLE; diff --git a/libportable/arch-mips/socket.c b/libportable/arch-mips/socket.c index d278384..85daadc 100644 --- a/libportable/arch-mips/socket.c +++ b/libportable/arch-mips/socket.c @@ -2,6 +2,10 @@ #include <sys/socket.h> #include <sys/linux-syscalls.h> +#if SOCK_STREAM==1 +#error Bad build environment +#endif + static inline int mips_change_type(int type) { switch (type) { case SOCK_DGRAM: return 2; |