From a011dbdd7ad1da626e749bf27831c90be2658af9 Mon Sep 17 00:00:00 2001 From: Albom Date: Fri, 20 Sep 2013 18:43:52 +0000 Subject: [PATCH] MSVC-style attributes for data align in structures (thanks to CleverMouse and Kirakishou!) git-svn-id: svn://kolibrios.org@3916 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/shell/History.txt | 3 ++ programs/system/shell/globals.h | 2 +- programs/system/shell/system/kolibri.h | 53 +++++++++++++++----------- 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/programs/system/shell/History.txt b/programs/system/shell/History.txt index c9175511e..a46ba885b 100644 --- a/programs/system/shell/History.txt +++ b/programs/system/shell/History.txt @@ -1,3 +1,6 @@ +Shell 0.6.3 // 20.09.2013 // Albom +* msvc-style атрибуты для отключения выравнивания в структурах (спасибо CleverMouse и Kirakishou!) + Shell 0.6.2 // 24.02.2013 // Albom * Добавлена обработка управляющих символов (\n, \t, \", \', \\, \?) diff --git a/programs/system/shell/globals.h b/programs/system/shell/globals.h index d1f6ea672..888156482 100644 --- a/programs/system/shell/globals.h +++ b/programs/system/shell/globals.h @@ -1,5 +1,5 @@ -#define SHELL_VERSION "0.6.2" +#define SHELL_VERSION "0.6.3" extern char PATH[256]; extern char PARAM[256]; diff --git a/programs/system/shell/system/kolibri.h b/programs/system/shell/system/kolibri.h index ae3cd2ebc..c7623c9fb 100644 --- a/programs/system/shell/system/kolibri.h +++ b/programs/system/shell/system/kolibri.h @@ -13,38 +13,45 @@ #define E_PARAM 33 +#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; +#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 p32[2]; +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();