Current cvs does not build on unix 
(normalize_path is only present in Windows)

This is a resend


Please tell me, what's wrong with this Patch.


-- 
 
By by ... Detlef

Index: tcc.c
===================================================================
RCS file: /sources/tinycc/tinycc/tcc.c,v
retrieving revision 1.189
diff -u -r1.189 tcc.c
--- tcc.c	4 Dec 2007 20:38:09 -0000	1.189
+++ tcc.c	7 Dec 2007 12:47:40 -0000
@@ -38,11 +38,11 @@
 #include <fcntl.h>
 #include <setjmp.h>
 #include <time.h>
-#ifdef WIN32
+#ifdef _WIN32
 #include <sys/timeb.h>
 // #include <windows.h>
 #endif
-#ifndef WIN32
+#ifndef _WIN32
 #include <sys/time.h>
 #include <sys/ucontext.h>
 #include <sys/mman.h>
@@ -86,12 +86,12 @@
 #define TCC_TARGET_I386
 #endif
 
-#if !defined(WIN32) && !defined(TCC_UCLIBC) && !defined(TCC_TARGET_ARM) && \
+#if !defined(_WIN32) && !defined(TCC_UCLIBC) && !defined(TCC_TARGET_ARM) && \
     !defined(TCC_TARGET_C67)
 #define CONFIG_TCC_BCHECK /* enable bound checking code */
 #endif
 
-#if defined(WIN32) && !defined(TCC_TARGET_PE)
+#if defined(_WIN32) && !defined(TCC_TARGET_PE)
 #define CONFIG_TCC_STATIC
 #endif
 
@@ -722,7 +722,7 @@
 
 #define TOK_UIDENT TOK_DEFINE
 
-#ifdef WIN32
+#ifdef _WIN32
 int __stdcall GetModuleFileNameA(void *, char *, int);
 void *__stdcall GetProcAddress(void *, const char *);
 void *__stdcall GetModuleHandleA(const char *);
@@ -967,7 +967,7 @@
     return NULL;
 }
 
-#elif !defined(WIN32)
+#elif !defined(_WIN32)
 
 #include <dlfcn.h>
 
@@ -1035,7 +1035,7 @@
     return 1;
 }
 
-#ifdef WIN32
+#ifdef _WIN32
 char *normalize_slashes(char *path)
 {
     char *p;
@@ -1047,7 +1047,7 @@
 
 char *w32_tcc_lib_path(void)
 {
-    /* on win32, we suppose the lib and includes are at the location
+    /* on _WIN32, we suppose the lib and includes are at the location
        of 'tcc.exe' */
     char path[1024], *p;
     GetModuleFileNameA(NULL, path, sizeof path);
@@ -1887,7 +1887,9 @@
     bf->buf_end = bf->buffer;
     bf->buffer[0] = CH_EOB; /* put eob symbol */
     pstrcpy(bf->filename, sizeof(bf->filename), filename);
+#ifdef _WIN32
     normalize_slashes(bf->filename);
+#endif
     bf->line_num = 1;
     bf->ifndef_macro = 0;
     bf->ifdef_stack_ptr = s1->ifdef_stack_ptr;
@@ -9724,7 +9726,7 @@
     fprintf(stderr, "\n");
 }
 
-#if !defined(WIN32) && !defined(CONFIG_TCCBOOT)
+#if !defined(_WIN32) && !defined(CONFIG_TCCBOOT)
 
 #ifdef __i386__
 
@@ -9889,7 +9891,7 @@
         s = s1->sections[i];
         if ((s->sh_flags & (SHF_ALLOC | SHF_EXECINSTR)) == 
             (SHF_ALLOC | SHF_EXECINSTR)) {
-#ifdef WIN32
+#ifdef _WIN32
             {
                 unsigned long old_protect;
                 VirtualProtect(s->data, s->data_offset,
@@ -9921,7 +9923,7 @@
     prog_main = tcc_get_symbol_err(s1, "main");
     
     if (do_debug) {
-#if defined(WIN32) || defined(CONFIG_TCCBOOT)
+#if defined(_WIN32) || defined(CONFIG_TCCBOOT)
         error("debug mode currently not available for Windows");
 #else        
         struct sigaction sigact;
@@ -10461,7 +10463,7 @@
     char *p = strchr(name, 0);
     while (p > name
         && p[-1] != '/'
-#ifdef WIN32
+#ifdef _WIN32
         && p[-1] != '\\'
 #endif
         )
@@ -10473,7 +10475,7 @@
 
 static int64_t getclock_us(void)
 {
-#ifdef WIN32
+#ifdef _WIN32
     struct _timeb tb;
     _ftime(&tb);
     return (tb.time * 1000LL + tb.millitm) * 1000LL;
@@ -10849,7 +10851,7 @@
     char objfilename[1024];
     int64_t start_time = 0;
 
-#ifdef WIN32
+#ifdef _WIN32
     tcc_lib_path = w32_tcc_lib_path();
 #endif
 
Index: elf.h
===================================================================
RCS file: /sources/tinycc/tinycc/elf.h,v
retrieving revision 1.5
diff -u -r1.5 elf.h
--- elf.h	4 Dec 2007 20:38:09 -0000	1.5
+++ elf.h	7 Dec 2007 16:33:30 -0000
@@ -21,7 +21,7 @@
 #ifndef _ELF_H
 #define	_ELF_H 1
 
-#ifndef WIN32
+#ifndef _WIN32
 #include <inttypes.h>
 #else
 #ifndef __int8_t_defined
Index: tccpe.c
===================================================================
RCS file: /sources/tinycc/tinycc/tccpe.c,v
retrieving revision 1.6
diff -u -r1.6 tccpe.c
--- tccpe.c	17 Jun 2005 21:31:04 -0000	1.6
+++ tccpe.c	7 Dec 2007 16:33:33 -0000
@@ -397,7 +397,7 @@
     return sym_index;
 }
 
-#ifdef WIN32
+#ifdef _WIN32
 ST void **pe_imp;
 ST int nb_pe_imp;
 
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to