History

fix build with msvc

grischka committed 17 years ago

Commit ca4b4a51 parent 03c787d2 files · +9 −17Browse files

Unified · Split

2 files
  1. tcc.h +3 −2
  2. win32/tools/tiny_libmaker.c +6 −15
tcc.h+3−2
@@ -42,9 +42,10 @@ · 41 unmodified lines
4242 #ifdef _WIN32
4343 #include <windows.h>
4444 #include <sys/timeb.h>
45−#ifdef _MSC_VER
45+#include <io.h> /* open, close etc. */
46+#include <direct.h> /* getcwd */
4647 #define inline __inline
47−#endif
48+#define inp next_inp
4849 #endif
4950
5051 #ifndef _WIN32
win32/tools/tiny_libmaker.c+6−15
@@ -9,6 +9,9 @@ · 8 unmodified lines
99 #include <stdio.h>
1010 #include <stdlib.h>
1111 #include <string.h>
12+#ifdef _WIN32
13+#include <io.h> /* for mktemp */
14+#endif
1215
1316 /* #include "ar-elf.h" */
1417 /* "ar-elf.h" */
@@ -177,25 +180,13 @@ int main(int argc, char **argv) · 162 unmodified lines
177180 }
178181 }
179182
180− //tfile[0] = '.'; tfile[1] = '/';
181− //if (tmpnam(&tfile[2])) {
182183 strcpy(tfile, "./XXXXXX");
183− if (mktemp(tfile))
184+ if (!mktemp(tfile) || (fo = fopen(tfile, "wb+")) == NULL)
184185 {
185− if ((fo = fopen(tfile, "wb+")) == NULL)
186− {
187− fprintf(stderr, "Can't open file %s \n", tfile);
188− return 2;
189− }
190− }
191−
192−/*
193− if ((fo = tmpfile()) == NULL)
194− {
195− fprintf(stderr, "Can't open temporary file \n");
186+ fprintf(stderr, "Can't open temporary file %s\n", tfile);
196187 return 2;
197188 }
198−*/
189+
199190 if ((fh = fopen(afile, "wb")) == NULL)
200191 {
201192 fprintf(stderr, "Can't open file %s \n", afile);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t