summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c1fd17b)
raw | patch | inline | side by side (parent: c1fd17b)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 3 Aug 2019 17:51:19 +0000 (20:51 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 3 Aug 2019 17:51:19 +0000 (20:51 +0300) |
C/SYSTEM.h | patch | blob | history | |
C/_windows.h | patch | blob | history | |
make.sh | patch | blob | history |
diff --git a/C/SYSTEM.h b/C/SYSTEM.h
index 183da76118b1309c52c791a384689f08c8df0789..f0d6a9fe0046a7ac139dccac7c8ba5c5d27614a1 100644 (file)
--- a/C/SYSTEM.h
+++ b/C/SYSTEM.h
*/\r
\r
\r
-#pragma warning(disable:4101) // disable "unreferenced variable" warning\r
+#pragma warning(disable:4101) /* disable "unreferenced variable" warning */\r
\r
#ifdef __GNUC__\r
# include <alloca.h>\r
#include <malloc.h>\r
#include <string.h>\r
\r
-// extern char *memcpy();\r
+/* extern char *memcpy(); */\r
\r
#define export\r
#define import extern\r
typedef short SHORTINT;\r
typedef int INTEGER;\r
#if !defined(_WIN64) && ((__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__))\r
- typedef long LONGINT; // LP64\r
+ typedef long LONGINT; /* LP64 */\r
typedef unsigned long __U_LONGINT;\r
#else\r
- typedef long long LONGINT; // ILP32 or LLP64\r
+ typedef long long LONGINT; /* ILP32 or LLP64 */\r
typedef unsigned long long __U_LONGINT;\r
#endif\r
typedef float SHORTREAL;\r
#define __MOVE(s, d, n) memcpy((char*)(d),(char*)(s),n)\r
\r
/* std procs and operator mappings */\r
-// #define __SHORT(x, y) ((int)((unsigned)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0)))\r
-// #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y)))\r
-// #define __CHR(x) ((CHAR)__R(x, 256))\r
-// #define __CHRF(x) ((CHAR)__RF(x, 256))\r
+/*\r
+#define __SHORT(x, y) ((int)((unsigned)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) \r
+#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y)))\r
+#define __CHR(x) ((CHAR)__R(x, 256))\r
+#define __CHRF(x) ((CHAR)__RF(x, 256))\r
+*/\r
#define __DIV(x, y) ((x)>=0?(x)/(y):~(~(x)/(y)))\r
#define __DIVF(x, y) SYSTEM_DIV(x,y)\r
#define __DIVFL(x, y) SYSTEM_DIVL(x,y)\r
/* runtime checks */\r
#define __X(i, ub) (((unsigned)(i)<(unsigned)(ub))?i:(__HALT(-7),0))\r
#define __XF(i, ub) SYSTEM_XCHK((INTEGER)(i), (INTEGER)(ub))\r
-// #define __RETCHK __retchk: __HALT(-3)\r
+/*\r
+#define __RETCHK __retchk: __HALT(-3)\r
+*/\r
#define __RETCHK __HALT(-3)\r
#define __CASECHK __HALT(-2)\r
#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-4),p)))\r
diff --git a/C/_windows.h b/C/_windows.h
index 74a04c3b07128262d9e68c1a2cc51a31ca61a5ac..dee2e3e5734fe3a5956515035b88103d7008ab6b 100644 (file)
--- a/C/_windows.h
+++ b/C/_windows.h
-// windows.h wrapper\r
-// Includes windows.h while avoiding conflicts with Component Pascal types.\r
+/* windows.h wrapper */\r
+/* Includes windows.h while avoiding conflicts with Component Pascal types. */\r
\r
#define BOOLEAN _BOOLEAN\r
#define BYTE _BYTE\r
#define CHAR _CHAR\r
\r
#undef _WIN32_WINNT\r
-// 0x0501 is for Windows XP (no service pack)\r
+/* 0x0501 is for Windows XP (no service pack) */\r
#define _WIN32_WINNT 0x0501\r
#include <windows.h>\r
\r
index 2c0c53b4d632b0fb31c5737c08976cfa47a9fae7..2b505534d7e5b7394a67b66bc31f8fe516daea6d 100755 (executable)
--- a/make.sh
+++ b/make.sh
done
local _cc_cflags=
case "$CC" in
- *gcc) _cc_cflags="-g -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-implicit-function-declaration" ;;
+ *gcc) _cc_cflags="-std=c89 -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-implicit-function-declaration" ;;
*) _cc_cflags="" ;;
esac
local _cpu_cflags=
cygwin) _system_cflags="-liconv" ;;
*) _system_cflags="" ;;
esac
- "$CC" $_cc_cflags $_cpu_cflags $CFLAGS -o "${_main}" -I "$_this/C" "$_this/C/SYSTEM.c" $_list -lm -ldl -lffi $_system_cflags
+ "$CC" -g -D_XOPEN_SOURCE=700 $_cc_cflags $_cpu_cflags $CFLAGS -o "${_main}" -I "$_this/C" "$_this/C/SYSTEM.c" $_list -lm -ldl -lffi $_system_cflags
fi
}