diff --git a/lib/hcl-prv.h b/lib/hcl-prv.h index d6f80da..fdbf345 100644 --- a/lib/hcl-prv.h +++ b/lib/hcl-prv.h @@ -261,7 +261,7 @@ (((hcl_oow_t)spec) & HCL_LBMASK(hcl_oow_t, HCL_CLASS_SELFSPEC_FLAG_BITS)) #define HCL_CLASS_SELFSPEC_FLAG_FINAL (1 << 0) -#define HCL_CLASS_SELFSPEC_FLAG_LIMITED (1 << 1) +#define HCL_CLASS_SELFSPEC_FLAG_LIMITED (1 << 1) /* not allowed to instantiate normally */ #define HCL_MAX_CLASSVARS HCL_BITS_MAX(hcl_oow_t, HCL_CLASS_SELFSPEC_CLASSVAR_BITS) diff --git a/lib/std.c b/lib/std.c index 95b885c..321da3f 100644 --- a/lib/std.c +++ b/lib/std.c @@ -2904,15 +2904,18 @@ static HCL_INLINE void stop_ticker (void) os2_tick_done = 1; } -#elif defined(__DOS__) && (defined(_INTELC32_) || defined(__WATCOMC__)) +#elif defined(__DOS__) && (defined(_INTELC32_) || defined(__WATCOMC__) || defined(__BORLANDC__)) #if defined(_INTELC32_) static void (*dos_prev_timer_intr_handler) (void); #pragma interrupt(dos_timer_intr_handler) static void dos_timer_intr_handler (void) -#else +#elif defined(__WATCOMC__) static void (__interrupt *dos_prev_timer_intr_handler) (void); static void __interrupt dos_timer_intr_handler (void) +#else +static void (interrupt *dos_prev_timer_intr_handler) (void); +static void interrupt dos_timer_intr_handler (void) #endif { /* @@ -3113,11 +3116,18 @@ static HCL_INLINE void stop_ticker (void) # define sys_dl_getsym(x,n) GetProcAddress(x,n) #elif defined(USE_MACH_O_DYLD) -# define sys_dl_error() mach_dlerror() +# define sys_dl_error(void) mach_dlerror() # define sys_dl_open(x) mach_dlopen(x) # define sys_dl_openext(x) mach_dlopen(x) # define sys_dl_close(x) mach_dlclose(x) # define sys_dl_getsym(x,n) mach_dlsym(x,n) + +#else +static const char* sys_dl_error(void) { return HCL_NULL; } +static void* sys_dl_open(const char* x) { return HCL_NULL; } +static void* sys_dl_openext(const char* x) { return HCL_NULL; } +static void sys_dl_close(void* x) { return HCL_NULL; } +static void* sys_dl_getsym(void* x, const char* n) { return HCL_NULL; } #endif #if defined(USE_WIN_DLL) diff --git a/src/kernel.hcl b/src/kernel.hcl index c74cb62..fe57565 100644 --- a/src/kernel.hcl +++ b/src/kernel.hcl @@ -1,9 +1,9 @@ class Apex { - fun ::basicNew(size) { + fun(#class) basicNew(size) { return (core.basicNew self size) } - fun ::respondsTo(mth) { + fun(#class) respondsTo(mth) { return (core.classRespondsTo self mth) } @@ -32,10 +32,10 @@ class Apex { } } -class Object :: Apex { +class Object: Apex { } -class Class :: Apex [ +class(#uncopyable #varying #limited) Class: Apex [ _name _mdic _spec @@ -62,13 +62,13 @@ class Class :: Apex [ } } -class Collection :: Object { +class Collection: Object { fun length() { return (core.basicSize self) } } -class IndexedCollection :: Collection { +class IndexedCollection: Collection { fun slice(index count) { return (core.slice self index count) } @@ -82,8 +82,8 @@ class IndexedCollection :: Collection { } } -class FixedSizedCollection :: IndexedCollection { - fun ::new(size) { +class FixedSizedCollection: IndexedCollection { + fun(#class) new(size) { | obj iv | obj := (core.basicNew self size) if (self:respondsTo "initValue") { ## TODO: change "initValue" to a symbol once supported @@ -102,11 +102,11 @@ class FixedSizedCollection :: IndexedCollection { ##} } -class Array :: FixedSizedCollection { +class Array: FixedSizedCollection { } -class String :: FixedSizedCollection { - fun ::initValue() { +class String: FixedSizedCollection { + fun(#class) initValue() { ##return '\0' return ' ' } @@ -166,8 +166,8 @@ printf "----------------------------------------\n" k := #[1 2 3] printf "%O\n" (k:basicAt 2) -class Z :: Object [ a b c ] { - fun :* new() { +class Z: Object [ a b c ] { + fun(#classinst) new() { self.a := 10 self.b := 20 self.c := 30