Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1901 → Rev 5098

/programs/develop/libraries/gblib/Tupfile.lua
0,0 → 1,2
if tup.getconfig("NO_GCC") ~= "" then return end
tup.rule("gblib.c", "kos32-gcc -fno-ident -Os -c -o %o %f " .. tup.getconfig("KPACK_CMD"), "gblib.obj")
/programs/develop/libraries/gblib/example/Tupfile.lua
0,0 → 1,7
if tup.getconfig("NO_FASM") ~= "" or tup.getconfig("NO_GCC") ~= "" then return end
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../../.." or tup.getconfig("HELPERDIR")
tup.include(HELPERDIR .. "/use_gcc.lua")
LDFLAGS = LDFLAGS .. " -T kolibri.ld"
tup.append_table(OBJS, tup.rule("asm_code.asm", "fasm %f %o", "asm_code.o"))
compile_gcc{"example.c", "system/kolibri.c", "system/stdlib.c", "system/string.c"}
link_gcc("example")
/programs/develop/libraries/gblib/example/gblib.h
1,11 → 1,13
 
#pragma pack(push, 1)
typedef struct
{
int w __attribute__((packed));
int h __attribute__((packed));
char *bmp __attribute__((packed));
char *alpha __attribute__((packed));
} GB_BMP __attribute__((packed));
int w;
int h;
char *bmp;
char *alpha;
} GB_BMP;
#pragma pack(pop)
 
 
void (* __stdcall gb_pixel_set)(GB_BMP *b, int x, int y, unsigned c);
/programs/develop/libraries/gblib/example/kolibri.ld
17,4 → 17,8
*(.bss)
}
Memory = . ;
/DISCARD/ : {
*(.comment)
*(.drectve)
}
}
/programs/develop/libraries/gblib/example/system/kolibri.h
1,38 → 1,40
 
#define NULL ((void*)0)
 
#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;
unsigned p08;
unsigned p12;
unsigned p16;
char p20;
char *p21;
} kol_struct70;
 
 
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 p32[2];
unsigned p40;
} kol_struct_BDVK;
 
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();