A current commit added "normalize_slashes()",
but this call in tcc_open() was not protected with _WIN32
WIN32 is not defined on all Windows Compilers (PellesC as example),
so i decided to use "_WIN32", as documented on msdn:
( http://msdn2.microsoft.com/en-us/library/b0084kay(VS.80).aspx )
--
By by ... Detlef
--- cvs/tcc.c 2007-11-28 15:17:16.000000000 +0100
+++ src/tcc.c 2007-11-28 22:38:08.000000000 +0100
@@ -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
@@ -720,7 +720,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 *);
@@ -965,7 +965,7 @@
return NULL;
}
-#elif !defined(WIN32)
+#elif !defined(_WIN32)
#include <dlfcn.h>
@@ -1033,7 +1033,7 @@
return 1;
}
-#ifdef WIN32
+#ifdef _WIN32
char *normalize_slashes(char *path)
{
char *p;
@@ -1885,7 +1885,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;
@@ -9665,7 +9667,7 @@
fprintf(stderr, "\n");
}
-#if !defined(WIN32) && !defined(CONFIG_TCCBOOT)
+#if !defined(_WIN32) && !defined(CONFIG_TCCBOOT)
#ifdef __i386__
@@ -9830,7 +9832,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,
@@ -9862,7 +9864,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;
@@ -10402,7 +10404,7 @@
char *p = strchr(name, 0);
while (p > name
&& p[-1] != '/'
-#ifdef WIN32
+#ifdef _WIN32
&& p[-1] != '\\'
#endif
)
@@ -10414,7 +10416,7 @@
static int64_t getclock_us(void)
{
-#ifdef WIN32
+#ifdef _WIN32
struct _timeb tb;
_ftime(&tb);
return (tb.time * 1000LL + tb.millitm) * 1000LL;
@@ -10790,7 +10792,7 @@
char objfilename[1024];
int64_t start_time = 0;
-#ifdef WIN32
+#ifdef _WIN32
tcc_lib_path = w32_tcc_lib_path();
#endif
--- cvs/tccpe.c 2005-06-17 23:31:04.000000000 +0200
+++ src/tccpe.c 2007-11-28 17:30:20.000000000 +0100
@@ -397,7 +397,7 @@
return sym_index;
}
-#ifdef WIN32
+#ifdef _WIN32
ST void **pe_imp;
ST int nb_pe_imp;
--- cvs/elf.h 2005-04-17 15:15:05.000000000 +0200
+++ src/elf.h 2007-11-28 17:28:34.000000000 +0100
@@ -21,7 +21,7 @@
#ifndef _ELF_H
#define _ELF_H 1
-#ifndef WIN32
+#ifndef _WIN32
#include <inttypes.h>
#else
#ifndef __int8_t_defined
_______________________________________________
Tinycc-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tinycc-devel