From 41e1692c06d81a72ab0ae88959dd730e6867339a Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Mon, 6 Nov 2017 10:58:50 +0100 Subject: [PATCH] -Fix: remove some warnings when cross compiling for mingw32 --- src/opendune.c | 3 +++ src/os/endian.h | 3 +++ src/os/strings.h | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/opendune.c b/src/opendune.c index 4a9987b9b..715ab32f9 100644 --- a/src/opendune.c +++ b/src/opendune.c @@ -1203,8 +1203,11 @@ int main(int argc, char **argv) char filter_text[64]; #if defined(_WIN32) #if defined(__MINGW32__) && defined(__STRICT_ANSI__) + #if 0 /* NOTE : disabled because it generates warnings when cross compiling + * for MinGW32 under linux */ int __cdecl __MINGW_NOTHROW _fileno (FILE*); #endif + #endif FILE *err = fopen("error.log", "w"); FILE *out = fopen("output.log", "w"); diff --git a/src/os/endian.h b/src/os/endian.h index 2ba8fea24..a2a3b4917 100644 --- a/src/os/endian.h +++ b/src/os/endian.h @@ -7,6 +7,9 @@ #if !defined(__LITTLE_ENDIAN) #define __LITTLE_ENDIAN 1234 #endif /* __LITTLE_ENDIAN */ + #if !defined(__BIG_ENDIAN) + #define __BIG_ENDIAN 4321 + #endif /* __BIG_ENDIAN */ #define __BYTE_ORDER __LITTLE_ENDIAN #elif defined(__APPLE__) || defined(__FreeBSD__) #include diff --git a/src/os/strings.h b/src/os/strings.h index a55434c5b..a06e8cec0 100644 --- a/src/os/strings.h +++ b/src/os/strings.h @@ -74,9 +74,12 @@ #include #if defined(__MINGW32__) && defined(__STRICT_ANSI__) + #if 0 /* NOTE : disabled because it generates warnings when cross compiling + * for MinGW32 under linux */ int __cdecl __MINGW_NOTHROW strcasecmp (const char *, const char *); int __cdecl __MINGW_NOTHROW strncasecmp (const char *, const char *, size_t); char* __cdecl __MINGW_NOTHROW strdup (const char*) __MINGW_ATTRIB_MALLOC; + #endif #endif /* __MINGW32__ && __STRICT_ANSI__ */ #if !defined(__MINGW32__) && defined(__GNUC__) && !defined(snprintf)