From 22de0f0003962adeccbf547f791cc63e6518f7c1 Mon Sep 17 00:00:00 2001 From: dsandersoremutah Date: Thu, 12 Oct 2006 18:35:44 +0000 Subject: [PATCH] Removed /zp1 compiler switch and added pragmas to do one-byte packing on structures. git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@987 0109f412-320b-0410-ab79-c3e0c5ffbbe6 --- flaim/Makefile | 4 ++-- flaim/src/flaim.h | 8 ++++++++ ftk/Makefile | 4 ++-- ftk/src/ftk.h | 26 ++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/flaim/Makefile b/flaim/Makefile index d0491da..2e48082 100644 --- a/flaim/Makefile +++ b/flaim/Makefile @@ -872,7 +872,7 @@ ifdef win_target # Compiler defines and flags - ccflags += /nologo /c /GF /GR /J /MD /W4 /WX /Zi /Zp1 + ccflags += /nologo /c /GF /GR /J /MD /W4 /WX /Zi ccdefs += _CRT_SECURE_NO_DEPRECATE ccdefs += WIN32_LEAN_AND_MEAN ccdefs += WIN32_EXTRA_LEAN @@ -1238,7 +1238,7 @@ ifdef netware_target ccdefs += FLM_LIBC_NLM endif - ccflags += /ez /6s /w4 /za /zp1 /zq /zm /s /ei /of+ /we /bt=NETWARE + ccflags += /ez /6s /w4 /za /zq /zm /s /ei /of+ /we /bt=NETWARE ifeq ($(target_build_type),release) ccflags += /oair diff --git a/flaim/src/flaim.h b/flaim/src/flaim.h index e6c0af8..0041395 100644 --- a/flaim/src/flaim.h +++ b/flaim/src/flaim.h @@ -30,6 +30,10 @@ #include "flaimtk.h" + #ifdef FLM_PACK_STRUCTS + #pragma pack(push, 1) + #endif + /// \defgroup dbsystem FLAIM System Functions /// \defgroup startupshutdown FLAIM System Startup/Shutdown @@ -5594,4 +5598,8 @@ ///< that password must be supplied to FlmDbOpen() when opening the database. ); + #ifdef FLM_PACK_STRUCTS + #pragma pack(pop) + #endif + #endif diff --git a/ftk/Makefile b/ftk/Makefile index 878d963..c36e20a 100644 --- a/ftk/Makefile +++ b/ftk/Makefile @@ -840,7 +840,7 @@ ifdef win_target # Compiler defines and flags - ccflags += /nologo /c /GF /GR /J /MD /W4 /WX /Zi /Zp1 + ccflags += /nologo /c /GF /GR /J /MD /W4 /WX /Zi ccdefs += _CRT_SECURE_NO_DEPRECATE ccdefs += WIN32_LEAN_AND_MEAN ccdefs += WIN32_EXTRA_LEAN @@ -1206,7 +1206,7 @@ ifdef netware_target ccdefs += FLM_LIBC_NLM endif - ccflags += /ez /6s /w4 /za /zp1 /zq /zm /s /ei /of+ /we /bt=NETWARE + ccflags += /ez /6s /w4 /za /zq /zm /s /ei /of+ /we /bt=NETWARE ifeq ($(target_build_type),release) ccflags += /oair diff --git a/ftk/src/ftk.h b/ftk/src/ftk.h index 9f935ec..ed51558 100644 --- a/ftk/src/ftk.h +++ b/ftk/src/ftk.h @@ -376,6 +376,20 @@ #define xpcselany #endif + #if !defined( FLM_UNIX) && !defined( FLM_64BIT) + #define FLM_PACK_STRUCTS + #ifdef FLM_WIN + // For some reason, Windows emits a warning when the packing + // is changed. + + #pragma warning( disable : 4103) + #endif + #endif + + #ifdef FLM_PACK_STRUCTS + #pragma pack(push, 1) + #endif + typedef struct { FLMUINT32 l; @@ -384,6 +398,10 @@ FLMUINT8 b[ 8]; } FLM_GUID; + #ifdef FLM_PACK_STRUCTS + #pragma pack(pop) + #endif + #define RFLMIID const FLM_GUID & #define RFLMCLSID const FLM_GUID & #define FLMGUID FLM_GUID @@ -925,6 +943,10 @@ #define F_PUSHCOLOR F_PUSH_FORECOLOR F_PUSH_BACKCOLOR #define F_POPCOLOR F_POP_FORECOLOR F_POP_BACKCOLOR + #ifdef FLM_PACK_STRUCTS + #pragma pack(push, 1) + #endif + // IMPORTANT NOTE: This structure needs to be kept in sync with corresponding // structures and classes in java and C#. /**************************************************************************** @@ -7052,4 +7074,8 @@ FLMUINT f_getpid( void); + #ifdef FLM_PACK_STRUCTS + #pragma pack(pop) + #endif + #endif // FTK_H