aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2006-07-22 17:28:48 +0000
committerMax Horn2006-07-22 17:28:48 +0000
commit2859b647026af1a927d1a74100f125bbc0f77db3 (patch)
treee842c9e2e67296f5bbc48645ba49b469edb7bd22 /common
parent1ffd49604357ed6fd63e133369a89e3b57711ae2 (diff)
downloadscummvm-rg350-2859b647026af1a927d1a74100f125bbc0f77db3.tar.gz
scummvm-rg350-2859b647026af1a927d1a74100f125bbc0f77db3.tar.bz2
scummvm-rg350-2859b647026af1a927d1a74100f125bbc0f77db3.zip
Fix struct packing issues (macros are not resolve in #pragma params, at least for GCC)
svn-id: r23569
Diffstat (limited to 'common')
-rw-r--r--common/pack-end.h24
-rw-r--r--common/pack-start.h24
-rw-r--r--common/scummsys.h10
3 files changed, 53 insertions, 5 deletions
diff --git a/common/pack-end.h b/common/pack-end.h
new file mode 100644
index 0000000000..28461e16a7
--- /dev/null
+++ b/common/pack-end.h
@@ -0,0 +1,24 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2002-2006 The ScummVM project
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#if defined(SCUMMVM_USE_PRAGMA_PACK)
+ #pragma pack()
+#endif
diff --git a/common/pack-start.h b/common/pack-start.h
new file mode 100644
index 0000000000..b39238d03b
--- /dev/null
+++ b/common/pack-start.h
@@ -0,0 +1,24 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2002-2006 The ScummVM project
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#if defined(SCUMMVM_USE_PRAGMA_PACK)
+ #pragma pack(1)
+#endif
diff --git a/common/scummsys.h b/common/scummsys.h
index cb26901ddf..c1bfc50528 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -73,15 +73,15 @@
//
// By default we try to use pragma push/pop to ensure various structs we use
// are "packed". If your compiler doesn't support this pragma, you are in for
-// a problem. If you are lucky, an equivalent pragma is available, in which
-// case you can redefine these two macros appropriately. Or maybe your port
-// simply *always* packs everything, in which case you could #undefine them.
+// a problem. If you are lucky, there is a compiler switch, or another pragma,
+// doing the same thing -- in that case, try to modify common/pack-begin.h and
+// common/pack-end.h accordingly. Or maybe your port simply *always* packs
+// everything, in which case you could #undefine SCUMMVM_USE_PRAGMA_PACK.
//
// If neither is possible, tough luck. Try to contact the team, maybe we can
// come up with a solution, though I wouldn't hold my breath on it :-/.
//
-#define START_PACK_STRUCTS pack(push, 1)
-#define END_PACK_STRUCTS pack(pop)
+#define SCUMMVM_USE_PRAGMA_PACK
#if defined(_MSC_VER) && !defined(__SYMBIAN32__) && !defined(_WIN32_WCE)