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
42#ifdef _WIN3242#ifdef _WIN32
43#include <windows.h>43#include <windows.h>
44#include <sys/timeb.h>44#include <sys/timeb.h>
45#ifdef _MSC_VER45#include <io.h> /* open, close etc. */
46#include <direct.h> /* getcwd */
46#define inline __inline47#define inline __inline
47#endif48#define inp next_inp
48#endif49#endif
49 50
50#ifndef _WIN3251#ifndef _WIN32
win32/tools/tiny_libmaker.c+6−15
@@ -9,6 +9,9 @@ · 8 unmodified lines
9#include <stdio.h>9#include <stdio.h>
10#include <stdlib.h>10#include <stdlib.h>
11#include <string.h>11#include <string.h>
12#ifdef _WIN32
13#include <io.h> /* for mktemp */
14#endif
12 15
13/* #include "ar-elf.h" */16/* #include "ar-elf.h" */
14/* "ar-elf.h" */17/* "ar-elf.h" */
@@ -177,25 +180,13 @@ int main(int argc, char **argv) · 162 unmodified lines
177 }180 }
178 }181 }
179 182
180 //tfile[0] = '.'; tfile[1] = '/';
181 //if (tmpnam(&tfile[2])) {
182 strcpy(tfile, "./XXXXXX");183 strcpy(tfile, "./XXXXXX");
183 if (mktemp(tfile))184 if (!mktemp(tfile) || (fo = fopen(tfile, "wb+")) == NULL)
184 {185 {
185 if ((fo = fopen(tfile, "wb+")) == NULL)186 fprintf(stderr, "Can't open temporary file %s\n", tfile);
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");
196 return 2;187 return 2;
197 }188 }
198*/189
199 if ((fh = fopen(afile, "wb")) == NULL)190 if ((fh = fopen(afile, "wb")) == NULL)
200 {191 {
201 fprintf(stderr, "Can't open file %s \n", afile);192 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