diff --git a/ase/conf_vms.h b/ase/conf_vms.h new file mode 100644 index 00000000..b3899ae2 --- /dev/null +++ b/ase/conf_vms.h @@ -0,0 +1,31 @@ +/* TODO: please complete this file */ + +#define XP_ENDIAN_LITTLE + +#define SIZEOF_CHAR 1 +#define SIZEOF_SHORT 2 +#define SIZEOF_INT 4 + +#ifdef _WIN64 + #define SIZEOF_LONG 8 +#else + #define SIZEOF_LONG 4 +#endif + +#define SIZEOF_LONG_LONG 0 + +#define SIZEOF___INT8 1 +#define SIZEOF___INT16 2 +#define SIZEOF___INT32 4 +#define SIZEOF___INT64 8 +#define SIZEOF___INT128 0 + +#ifdef _WIN64 + #define SIZEOF_VOID_P 8 +#else + #define SIZEOF_VOID_P 4 +#endif + +#define SIZEOF_FLOAT 4 +#define SIZEOF_DOUBLE 8 +#define SIZEOF_LONG_DOUBLE 16 diff --git a/ase/stx/makefile.tcc b/ase/stx/makefile.tcc index edd64481..7e4a7520 100644 --- a/ase/stx/makefile.tcc +++ b/ase/stx/makefile.tcc @@ -4,7 +4,7 @@ OBJS = $(SRCS:.c=.obj) OUT = xpstx.lib CC = c:\tc\tcc -CFLAGS = -I..\.. -D_DOS -mh -w +CFLAGS = -I..\.. -D_DOS -ml -w all: $(OBJS) c:\tc\tlib $(OUT) @&&! diff --git a/ase/stx/memory.c b/ase/stx/memory.c index 0c0f6ea0..b52ca563 100644 --- a/ase/stx/memory.c +++ b/ase/stx/memory.c @@ -1,5 +1,5 @@ /* - * $Id: memory.c,v 1.10 2005-05-19 16:41:10 bacon Exp $ + * $Id: memory.c,v 1.11 2005-05-20 04:01:12 bacon Exp $ */ #include @@ -70,7 +70,11 @@ xp_stx_word_t xp_stx_memory_alloc (xp_stx_memory_t* mem, xp_stx_word_t nbytes) if (object == XP_NULL) { xp_stx_memory_gc (mem); object = (xp_stx_object_t*)xp_stx_malloc (nbytes); - if (object == XP_NULL) return mem->capacity; + /*if (object == XP_NULL) return mem->capacity;*/ +if (object == XP_NULL) { +xp_stx_assert (XP_TEXT("MEMORY ALLOCATION ERROR\n") == XP_NULL); +exit (1); +} } slot = mem->free; diff --git a/ase/stx/stx.h b/ase/stx/stx.h index af516ce5..0594f4b2 100644 --- a/ase/stx/stx.h +++ b/ase/stx/stx.h @@ -1,5 +1,5 @@ /* - * $Id: stx.h,v 1.15 2005-05-19 16:41:10 bacon Exp $ + * $Id: stx.h,v 1.16 2005-05-20 04:01:12 bacon Exp $ */ #ifndef _XP_STX_STX_H_ @@ -15,8 +15,10 @@ typedef xp_size_t xp_stx_size_t; typedef xp_size_t xp_stx_index_t; typedef struct xp_stx_object_t xp_stx_object_t; +/* typedef struct xp_stx_byte_object_t xp_stx_byte_object_t; typedef struct xp_stx_string_object_t xp_stx_string_object_t; +*/ typedef struct xp_stx_memory_t xp_stx_memory_t; typedef struct xp_stx_t xp_stx_t; @@ -107,6 +109,7 @@ struct xp_stx_t #define XP_STX_OBJECT(stx,idx) (((stx)->memory).slots[idx]) #define XP_STX_CLASS(stx,idx) (XP_STX_OBJECT(stx,(idx))->class) #define XP_STX_ACCESS(stx,idx) (XP_STX_OBJECT(stx,(idx))->access) +#define XP_STX_DATA(stx,idx) ((void*)(XP_STX_OBJECT(stx,idx) + 1)) #define XP_STX_TYPE(stx,idx) (XP_STX_ACCESS(stx,idx) & 0x03) #define XP_STX_SIZE(stx,idx) (XP_STX_ACCESS(stx,idx) >> 0x02) diff --git a/ase/test/stx/makefile.tcc b/ase/test/stx/makefile.tcc index 3572bcea..84139bd2 100644 --- a/ase/test/stx/makefile.tcc +++ b/ase/test/stx/makefile.tcc @@ -3,8 +3,8 @@ OBJS = stx.obj OUT = stx.exe CC = \tc\tcc -CFLAGS = -I..\..\.. -mh -D_DOS -w -LIBS = \tc\lib\ch.lib \tc\lib\c0h.obj ..\..\..\xp\stx\xpstx.lib +CFLAGS = -I..\..\.. -ml -D_DOS -w +LIBS = \tc\lib\cl.lib \tc\lib\c0l.obj ..\..\..\xp\stx\xpstx.lib all: $(OBJS) \tc\tlink $(OBJS),$(OUT),,$(LIBS) diff --git a/ase/test/stx/stx.c b/ase/test/stx/stx.c index 3a756aae..2572ac33 100644 --- a/ase/test/stx/stx.c +++ b/ase/test/stx/stx.c @@ -14,17 +14,13 @@ void print_symbol_names (xp_stx_t* stx, xp_stx_word_t sym) { - /* - xp_stx_word_t key = XP_STX_AT(stx,idx,1); - xp_printf (XP_TEXT("%u -> %s\n"), key, &XP_STX_CHARAT(stx,key,0)); - */ - xp_printf (XP_TEXT("%u -> %s\n"), sym, &XP_STX_CHARAT(stx,sym,0)); + xp_printf (XP_TEXT("%lu [%s]\n"), (unsigned long)sym, &XP_STX_CHARAT(stx,sym,0)); } void print_symbol_names_2 (xp_stx_t* stx, xp_stx_word_t idx) { xp_stx_word_t key = XP_STX_AT(stx,idx,1); - xp_printf (XP_TEXT("%u -> %s\n"), key, &XP_STX_CHARAT(stx,key,0)); + xp_printf (XP_TEXT("%lu [%s]\n"), (unsigned long)key, &XP_STX_CHARAT(stx,key,0)); } int xp_main (int argc, xp_char_t* argv[]) @@ -48,9 +44,9 @@ int xp_main (int argc, xp_char_t* argv[]) return -1; } - xp_printf (XP_TEXT("stx.nil %d\n"), stx.nil); - xp_printf (XP_TEXT("stx.true %d\n"), stx.true); - xp_printf (XP_TEXT("stx.false %d\n"), stx.false); + xp_printf (XP_TEXT("stx.nil %lu\n"), (unsigned long)stx.nil); + xp_printf (XP_TEXT("stx.true %lu\n"), (unsigned long)stx.true); + xp_printf (XP_TEXT("stx.false %lu\n"), (unsigned long)stx.false); xp_printf (XP_TEXT("-------------\n")); xp_stx_traverse_symbol_table (&stx, print_symbol_names); @@ -86,7 +82,7 @@ int xp_main (int argc, xp_char_t* argv[]) } xp_stx_close (&stx); - xp_printf (XP_TEXT("End of program\n")); + xp_printf (XP_TEXT("== End of program ==\n")); return 0; } diff --git a/ase/types.h b/ase/types.h index c31cede2..e0ea556d 100644 --- a/ase/types.h +++ b/ase/types.h @@ -1,5 +1,5 @@ /* - * $Id: types.h,v 1.25 2005-05-19 16:41:09 bacon Exp $ + * $Id: types.h,v 1.26 2005-05-20 04:01:12 bacon Exp $ */ #ifndef _XP_TYPES_H_ @@ -8,9 +8,9 @@ #if defined(_DOS) #include #elif defined(_WIN32) - #include + #include #elif defined(__VMS) - #include + #include #else #include #endif