]> Nishi Git Mirror - dataworks.git/commitdiff
add makefiles
authornishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Sun, 7 Jul 2024 17:44:18 +0000 (17:44 +0000)
committernishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Sun, 7 Jul 2024 17:44:18 +0000 (17:44 +0000)
git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@453 d4a5a174-5a4a-5b4b-b672-37683c10d7d5

Grammar/dw.l
Library/util.c
Makefiles/Platforms/djgpp.mk [new file with mode: 0644]

index 7c7029b4dec8fcf2c6794cea4de110297dc10a78..0ebfc7acf1fb919b446e88fbb5f63b9708092541 100644 (file)
@@ -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();
 }
 <DQ>\"                         {
-       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();
 }
 <SQ>\'                         {
-       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';
index fd9b813d059a33bcd4dafba3997fd8dcf55c6a7d..9abaa0364142d3a4281149f08b32f9577986bae3 100644 (file)
 #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 (file)
index 0000000..934d355
--- /dev/null
@@ -0,0 +1,9 @@
+# $Id$
+# PLATFORM: DJGPP
+
+CC = i586-pc-msdosdjgpp-gcc
+SHCC = true
+AR = i586-pc-msdosdjgpp-ar
+SERVER =
+RCLI =
+EXEC_SUFFIX = .exe