diff --git a/programs/develop/tinypy/modules/kolibri/fs.c b/programs/develop/tinypy/modules/kolibri/fs.c index ce94be5007..f4944f08a4 100755 --- a/programs/develop/tinypy/modules/kolibri/fs.c +++ b/programs/develop/tinypy/modules/kolibri/fs.c @@ -8,7 +8,7 @@ extern tp_obj tp_string(char const *v); extern tp_obj tp_list(TP); extern tp_obj tp_dict(TP); extern void _tp_raise(TP,tp_obj); -#define _cdecl __attribute__((cdecl)) +// #define _cdecl __attribute__((cdecl)) extern int (* _cdecl con_printf)(const char* format,...); #define call70(par, st) asm volatile ("int $0x40":"=a"(st):"a"(70), "b"(par)) diff --git a/programs/develop/tinypy/tinypy/Makefile b/programs/develop/tinypy/tinypy/Makefile index 55f9b76631..5a9d5c7a10 100644 --- a/programs/develop/tinypy/tinypy/Makefile +++ b/programs/develop/tinypy/tinypy/Makefile @@ -5,12 +5,12 @@ LD = kos32-ld SDK_DIR:= $(abspath ../../../../contrib/sdk) LDFLAGS = -static -nostdlib -T $(SDK_DIR)/sources/newlib/app.lds \ - --image-base 0 -lgcc -ldll -lc.dll + --image-base 0 -lgcc -lc.dll CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -mpreferred-stack-boundary=2 \ -mincoming-stack-boundary=2 -fno-builtin -fno-common -INCLUDES= -I. -I$(SDK_DIR)/sources/newlib/libc/include -I$(CLAYER)/INCLUDE +INCLUDES= -I. -I$(SDK_DIR)/sources/newlib/libc/include LIBPATH:= -L $(SDK_DIR)/lib -L /home/autobuild/tools/win32/mingw32/lib @@ -30,4 +30,4 @@ kolibri_dbg.obj: fasm_modules/kolibri_dbg.s cp fasm_modules/kolibri_dbg.obj . clean: - -rm -f *.o $(NAME).map fasm_modules/kolibri_dbg.obj kolibri_dbg.obj \ No newline at end of file + -rm -f *.o $(NAME).map fasm_modules/kolibri_dbg.obj kolibri_dbg.obj diff --git a/programs/develop/tinypy/tinypy/koconsole.c b/programs/develop/tinypy/tinypy/koconsole.c index f44185d035..e5fedd29a0 100644 --- a/programs/develop/tinypy/tinypy/koconsole.c +++ b/programs/develop/tinypy/tinypy/koconsole.c @@ -1,9 +1,9 @@ #include "kolibri.h" - +/* #define __stdcall __attribute__((stdcall)) #define _cdecl __attribute__((cdecl)) #define _stdcall __attribute__((stdcall)) - +*/ void (* _stdcall con_init)(unsigned w_w, unsigned w_h, unsigned s_w, unsigned s_h, const char* t); int (* _cdecl con_printf)(const char* format,...); void (* _stdcall con_exit)(char bCloseWindow); diff --git a/programs/develop/tinypy/tinypy/kolibri.h b/programs/develop/tinypy/tinypy/kolibri.h index 284a3934dd..7f88b458b3 100644 --- a/programs/develop/tinypy/tinypy/kolibri.h +++ b/programs/develop/tinypy/tinypy/kolibri.h @@ -1,39 +1,45 @@ - +#ifndef NULL #define NULL ((void*)0) +#endif +#pragma pack(push,1) typedef struct { -unsigned p00 __attribute__((packed)); -unsigned p04 __attribute__((packed)); -unsigned p08 __attribute__((packed)); -unsigned p12 __attribute__((packed)); -unsigned p16 __attribute__((packed)); -char p20 __attribute__((packed)); -char *p21 __attribute__((packed)); -} kol_struct70 __attribute__((packed)); +unsigned p00; +unsigned p04; +char *p08; +unsigned p12; +unsigned p16; +char p20; +char *p21; +} kol_struct70; +#pragma pack(pop) +#pragma pack(push,1) typedef struct { -unsigned p00 __attribute__((packed)); -char p04 __attribute__((packed)); -char p05[3] __attribute__((packed)); -unsigned p08 __attribute__((packed)); -unsigned p12 __attribute__((packed)); -unsigned p16 __attribute__((packed)); -unsigned p20 __attribute__((packed)); -unsigned p24 __attribute__((packed)); -unsigned p28 __attribute__((packed)); -unsigned p32[2] __attribute__((packed)); -unsigned p40 __attribute__((packed)); -} kol_struct_BDVK __attribute__((packed)); +unsigned p00; +char p04; +char p05[3]; +unsigned p08; +unsigned p12; +unsigned p16; +unsigned p20; +unsigned p24; +unsigned p28; +unsigned long long p32; +unsigned p40; +} kol_struct_BDVK; +#pragma pack(pop) +#pragma pack(push,1) typedef struct { -char *name __attribute__((packed)); -void *data __attribute__((packed)); -} kol_struct_import __attribute__((packed)); - +char *name; +void *data; +} kol_struct_import; +#pragma pack(pop) void kol_exit(); void kol_sleep(unsigned d); @@ -89,4 +95,4 @@ unsigned kol_sound_speaker(char data[]); unsigned kol_process_info(unsigned slot, char buf1k[]); int kol_process_kill_pid(unsigned process); void kol_get_kernel_ver(char buff16b[]); -int kol_kill_process(unsigned process); \ No newline at end of file +int kol_kill_process(unsigned process); diff --git a/programs/develop/tinypy/tinypy/kolibri_gui.c b/programs/develop/tinypy/tinypy/kolibri_gui.c index 0a4b70c3d3..4b7679f9fa 100644 --- a/programs/develop/tinypy/tinypy/kolibri_gui.c +++ b/programs/develop/tinypy/tinypy/kolibri_gui.c @@ -14,7 +14,7 @@ extern tp_obj tp_call(TP, const char *mod, const char *fnc, tp_obj params); extern void _tp_call(TP,tp_obj *dest, tp_obj fnc, tp_obj params); extern int tp_bool(TP,tp_obj v); extern tp_obj tp_has(TP,tp_obj self, tp_obj k); -#define _cdecl __attribute__((cdecl)) +// #define _cdecl __attribute__((cdecl)) extern int (* _cdecl con_printf)(const char* format,...); static tp_obj kolibri_show(TP) { diff --git a/programs/develop/tinypy/tinypy/kolibri_net.c b/programs/develop/tinypy/tinypy/kolibri_net.c index 3a34a8d174..a389bced68 100644 --- a/programs/develop/tinypy/tinypy/kolibri_net.c +++ b/programs/develop/tinypy/tinypy/kolibri_net.c @@ -8,7 +8,7 @@ extern tp_obj tp_method(TP,tp_obj self,tp_obj v(TP)); extern tp_obj tp_fnc(TP,tp_obj v(TP)); extern tp_obj tp_get(TP,tp_obj self, tp_obj k); tp_obj tp_has(TP,tp_obj self, tp_obj k); -#define _cdecl __attribute__((cdecl)) +// #define _cdecl __attribute__((cdecl)) extern int (* _cdecl con_printf)(const char* format,...); #define PRECISION 0.000001