From: nishi Date: Sun, 7 Jul 2024 17:44:18 +0000 (+0000) Subject: add makefiles X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=77df5258f1cf47ba1847c99f0db8b9ddeeafa57b;p=dataworks.git add makefiles git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@453 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- diff --git a/Grammar/dw.l b/Grammar/dw.l index 7c7029b..0ebfc7a 100644 --- a/Grammar/dw.l +++ b/Grammar/dw.l @@ -43,6 +43,10 @@ char* __dw_strdup(const char* a); #define strdup __dw_strdup #endif +#ifndef EINTR +#define EINTR 0 +#endif + #ifdef __VBCC__ int isatty(int fd){ return 0; @@ -105,7 +109,7 @@ void proc_esc(void){ proc_esc(); } \" { - yylval.node.string = strdup(str); + yylval.node.string = __dw_strdup(str); yylval.node.nodes = NULL; yylval.node.ident = NULL; yylval.node.type = 'S'; @@ -127,7 +131,7 @@ void proc_esc(void){ proc_esc(); } \' { - yylval.node.string = strdup(str); + yylval.node.string = __dw_strdup(str); yylval.node.nodes = NULL; yylval.node.ident = NULL; yylval.node.type = 'S'; @@ -137,7 +141,7 @@ void proc_esc(void){ } [ \t]*#.* { return (COMMENT); } [a-zA-Z_][a-zA-Z0-9_\-]+ { - yylval.node.ident = strdup(yytext); + yylval.node.ident = __dw_strdup(yytext); yylval.node.nodes = NULL; yylval.node.string = NULL; yylval.node.type = 'I'; diff --git a/Library/util.c b/Library/util.c index fd9b813..9abaa03 100644 --- a/Library/util.c +++ b/Library/util.c @@ -43,6 +43,10 @@ #endif #endif +#ifdef DJGPP +#define off_t uint64_t +#endif + char* __dw_strdup(const char* a) { char* str = malloc(strlen(a) + 1); memcpy(str, a, strlen(a)); @@ -77,6 +81,7 @@ bool __dw_lockfile(struct dataworks_db* db) { #elif defined(__VBCC__) +#elif defined(DJGPP) #elif defined(__MINGW32__) OVERLAPPED overlap = {0}; LockFileEx(db->fp, LOCKFILE_EXCLUSIVE_LOCK, 0, MAXDWORD, MAXDWORD, &overlap); @@ -99,6 +104,7 @@ bool __dw_unlockfile(struct dataworks_db* db) { #elif defined(__VBCC__) +#elif defined(DJGPP) #elif defined(__MINGW32__) OVERLAPPED overlap = {0}; UnlockFileEx(db->fp, 0, MAXDWORD, MAXDWORD, &overlap); diff --git a/Makefiles/Platforms/djgpp.mk b/Makefiles/Platforms/djgpp.mk new file mode 100644 index 0000000..934d355 --- /dev/null +++ b/Makefiles/Platforms/djgpp.mk @@ -0,0 +1,9 @@ +# $Id$ +# PLATFORM: DJGPP + +CC = i586-pc-msdosdjgpp-gcc +SHCC = true +AR = i586-pc-msdosdjgpp-ar +SERVER = +RCLI = +EXEC_SUFFIX = .exe