From: kvigor Date: Sat, 7 Jul 2001 05:37:22 +0000 (+0000) Subject: Working properly under Borland C++ now X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=6d31fd246c005902ba2a2725eb48e3c395405a10;p=fw%2Fsdcc Working properly under Borland C++ now git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1036 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/support/cpp2/borland.h b/support/cpp2/borland.h index 0fc50f50..59e352f4 100644 --- a/support/cpp2/borland.h +++ b/support/cpp2/borland.h @@ -21,7 +21,7 @@ #define HAVE_STRING_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_STDLIB_H 1 -#define ssize_t unsigned int +#define ssize_t int #define __STDC__ 1 #define alloca(x) calloc(1,(x)) diff --git a/support/cpp2/configargs.h b/support/cpp2/configargs.h deleted file mode 100644 index 6985a4b3..00000000 --- a/support/cpp2/configargs.h +++ /dev/null @@ -1,3 +0,0 @@ -/* Generated automatically. */ -static const char configuration_arguments[] = " : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) : (reconfigured) "; -static const char thread_model[] = ""; diff --git a/support/cpp2/cppfiles.c b/support/cpp2/cppfiles.c index 140e1e47..6c9a69fe 100644 --- a/support/cpp2/cppfiles.c +++ b/support/cpp2/cppfiles.c @@ -378,6 +378,7 @@ read_include_file (pfile, inc) SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ +#ifndef __BORLANDC__ if (inc->st.st_size > INTTYPE_MAXIMUM (ssize_t)) { cpp_error (pfile, "%s is too large (%lu > %lu)", inc->name, @@ -385,6 +386,7 @@ read_include_file (pfile, inc) INTTYPE_MAXIMUM(ssize_t)); goto fail; } +#endif size = inc->st.st_size; inc->mapped = 0; @@ -411,7 +413,18 @@ read_include_file (pfile, inc) goto perror_fail; if (count == 0) { - cpp_warning (pfile, "%s is shorter than expected", inc->name); +#ifndef __BORLANDC__ + /* For some reason, even though we opened with O_BINARY, + * Borland C++ seems to insist on doing CR/LF -> LF + * translations for us, which results in the file appearing + * shorter than stat told us it should be. + * + * This sucks, but don't bother throwing a warning. + */ + cpp_warning (pfile, "%s is shorter than expected (expected %u, got %u)", + inc->name, inc->st.st_size, offset); +#endif + inc->st.st_size = offset; break; } offset += count;