More hacks for non-windows systems

This commit is contained in:
Víctor Román Archidona 2014-07-23 13:09:38 +02:00
parent 506deee4ab
commit 82fd399ead

View file

@ -20,7 +20,10 @@
#include <assert.h> #include <assert.h>
#ifndef __APPLE__
#include <io.h> #include <io.h>
#endif
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -36,6 +39,10 @@
#include "varindex.h" #include "varindex.h"
#include "fatal.h" #include "fatal.h"
#ifndef _WIN32
#define _strdup strdup
#endif
#define long_header 9 // Longitud de la cabecera al inicio de los programas #define long_header 9 // Longitud de la cabecera al inicio de los programas
@ -108,7 +115,12 @@ int main(int argc, char* argv[])
} }
#endif #endif
// assert(0) ; // assert(0) ;
#ifdef _WIN32
if((f=open(argv[0],O_RDONLY | O_BINARY))==-1) { if((f=open(argv[0],O_RDONLY | O_BINARY))==-1) {
#else
if((f=open(argv[0],O_RDONLY))==-1) {
#endif
/*#ifdef WIN32 /*#ifdef WIN32
strcat(argv[0],".exe"); strcat(argv[0],".exe");
printf("%s\n",argv[0]); printf("%s\n",argv[0]);