diff options
Diffstat (limited to 'Tools/CCode/Source/Common')
-rw-r--r-- | Tools/CCode/Source/Common/CommonLib.c | 8 | ||||
-rw-r--r-- | Tools/CCode/Source/Common/CommonLib.h | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Tools/CCode/Source/Common/CommonLib.c b/Tools/CCode/Source/Common/CommonLib.c index 4d1663a55a..618abd89bb 100644 --- a/Tools/CCode/Source/Common/CommonLib.c +++ b/Tools/CCode/Source/Common/CommonLib.c @@ -495,6 +495,14 @@ Returns: }
#ifdef __GNUC__
+
+size_t _filelength(FILE *file)
+{
+ struct stat stat_buf;
+ fstat(fileno(file), &stat_buf);
+ return stat_buf.st_size;
+}
+
#ifndef __CYGWIN__
char *strlwr(char *s)
{
diff --git a/Tools/CCode/Source/Common/CommonLib.h b/Tools/CCode/Source/Common/CommonLib.h index 46f0cbace5..f6c29ef8a8 100644 --- a/Tools/CCode/Source/Common/CommonLib.h +++ b/Tools/CCode/Source/Common/CommonLib.h @@ -124,9 +124,13 @@ PrintGuidToBuffer ( #define ASSERT(x) assert(x)
#ifdef __GNUC__
+#include <stdio.h>
+#include <sys/stat.h>
#define stricmp strcasecmp
+#define _stricmp strcasecmp
#define strnicmp strncasecmp
#define strcmpi strcasecmp
+size_t _filelength(FILE *file);
#ifndef __CYGWIN__
char *strlwr(char *s);
#endif
|