diff --git a/ase/awk/makefile.tcc b/ase/awk/makefile.tcc new file mode 100644 index 00000000..31d549e6 --- /dev/null +++ b/ase/awk/makefile.tcc @@ -0,0 +1,20 @@ +SRCS = awk.c err.c tree.c tab.c map.c parse.c run.c sa.c val.c misc.c +OBJS = $(SRCS:.c=.obj) +OUT = xpawk.lib + +CC = tcc +CFLAGS = -1 -O -mh -I..\.. -Ddos -DXP_AWK_STAND_ALONE + +all: $(OBJS) + tlib $(OUT) @&&! ++-$(**: = &^ ++-) +! + +clean: + del $(OBJS) $(OUT) *.obj + +.SUFFIXES: .c .obj +.c.obj: + $(CC) $(CFLAGS) -c $< + diff --git a/ase/awk/sa.c b/ase/awk/sa.c index ecd95a73..0d958580 100644 --- a/ase/awk/sa.c +++ b/ase/awk/sa.c @@ -1,5 +1,5 @@ /* - * $Id: sa.c,v 1.18 2006-04-21 16:21:27 bacon Exp $ + * $Id: sa.c,v 1.19 2006-04-30 18:05:07 bacon Exp $ */ #include @@ -133,7 +133,9 @@ int xp_vsprintf (xp_char_t* buf, xp_size_t size, const xp_char_t* fmt, xp_va_lis xp_char_t* nf = __adjust_format (fmt); if (nf == XP_NULL) return -1; -#if defined(XP_CHAR_IS_MCHAR) +#if defined(dos) || defined(__dos) + n = vsprintf (buf, nf, ap); /* TODO: write your own vsnprintf */ +#elif defined(XP_CHAR_IS_MCHAR) n = vsnprintf (buf, size, nf, ap); #elif defined(_WIN32) n = _vsnwprintf (buf, size, nf, ap); diff --git a/ase/awk/val.h b/ase/awk/val.h index 18d70628..e3c3f0cf 100644 --- a/ase/awk/val.h +++ b/ase/awk/val.h @@ -1,5 +1,5 @@ /* - * $Id: val.h,v 1.21 2006-04-26 15:53:17 bacon Exp $ + * $Id: val.h,v 1.22 2006-04-30 18:05:07 bacon Exp $ */ #ifndef _XP_AWK_VAL_H_ @@ -27,14 +27,15 @@ typedef struct xp_awk_val_str_t xp_awk_val_str_t; typedef struct xp_awk_val_rex_t xp_awk_val_rex_t; typedef struct xp_awk_val_map_t xp_awk_val_map_t; +#if XP_SIZEOF_INT == 2 #define XP_AWK_VAL_HDR \ unsigned int type: 3; \ - unsigned int ref: 28 -/* + unsigned int ref: 13 +#else #define XP_AWK_VAL_HDR \ - int type: 4; \ - int ref: 27 -*/ + unsigned int type: 3; \ + unsigned int ref: 29 +#endif struct xp_awk_val_t { diff --git a/ase/conf_dos.h b/ase/conf_dos.h index 5efdaeea..167e63f7 100644 --- a/ase/conf_dos.h +++ b/ase/conf_dos.h @@ -1,5 +1,5 @@ /* - * $Id: conf_dos.h,v 1.3 2006-04-30 17:35:37 bacon Exp $ + * $Id: conf_dos.h,v 1.4 2006-04-30 18:05:07 bacon Exp $ */ #if !defined(__LARGE__) && !defined(__HUGE__) @@ -26,3 +26,5 @@ #define XP_SIZEOF_FLOAT 4 #define XP_SIZEOF_DOUBLE 8 #define XP_SIZEOF_LONG_DOUBLE 10 /* turbo c 2.01 */ + +#define XP_CHAR_IS_MCHAR diff --git a/ase/test/awk/awk.c b/ase/test/awk/awk.c index 4a5b7024..b7afb0c5 100644 --- a/ase/test/awk/awk.c +++ b/ase/test/awk/awk.c @@ -1,11 +1,13 @@ /* - * $Id: awk.c,v 1.26 2006-04-22 13:54:53 bacon Exp $ + * $Id: awk.c,v 1.27 2006-04-30 18:05:07 bacon Exp $ */ #include -#include #include #include +#ifdef XP_CHAR_IS_CHAR +#include +#endif #ifdef __STAND_ALONE #define xp_printf xp_awk_printf diff --git a/ase/test/awk/makefile.tcc b/ase/test/awk/makefile.tcc new file mode 100644 index 00000000..4c237d3c --- /dev/null +++ b/ase/test/awk/makefile.tcc @@ -0,0 +1,17 @@ +CC = tcc +CFLAGS = -1 -O -mh -I..\..\.. -Ddos -D__STAND_ALONE +LDFLAGS = -L..\..\awk +LIBS = xpawk.lib + +all: awk + +awk: awk.obj + tcc $(LDFLAGS) -eawk.exe awk.obj $(LIBS) + +clean: + del $(OBJS) *.obj $(OUT) + +.SUFFIXES: .c .obj +.c.obj: + $(CC) $(CFLAGS) -c $< +