Permalink
Browse files

Allow compilation on OpenBSD i386 and amd64 without warnings

  • Loading branch information...
1 parent 2010bad commit 6d300022d7332f66010d63fd29d71872ecefb89e @jturner jturner committed with fogus Nov 11, 2010
Showing with 10 additions and 1 deletion.
  1. +8 −0 core/opcodes.h
  2. +2 −1 tools/config.sh
View
8 core/opcodes.h
@@ -7,15 +7,23 @@
#ifndef POTION_OPCODES_H
#define POTION_OPCODES_H
+#if defined(__GNUC__)
+#pragma pack(1)
+#else
#pragma pack(push, 1)
+#endif
typedef struct {
u8 code:8;
int a:12;
int b:12;
} PN_OP;
+#if defined(__GNUC__)
+#pragma pack()
+#else
#pragma pack(pop)
+#endif
#define PN_OP_AT(asmb, n) ((PN_OP *)((PNFlex *)asmb)->ptr)[n]
#define PN_OP_LEN(asmb) (PN_FLEX_SIZE(asmb) / sizeof(PN_OP))
View
3 tools/config.sh
@@ -15,6 +15,7 @@ fi
JIT_X86=`echo "$TARGET" | sed "/86/!d"`
JIT_PPC=`echo "$TARGET" | sed "/powerpc/!d"`
JIT_I686=`echo "$TARGET" | sed "/i686/!d"`
+JIT_AMD64=`echo "$TARGET" | sed "/amd64/!d"`
if [ $MINGW -eq 0 ]; then
LONG=`echo "#include <stdio.h>
@@ -56,7 +57,7 @@ elif [ "$2" = "strip" ]; then
ARGDIR="1"
fi
-if [ "$2" = "mingw" ]; then
+if [ "$2" = "mingw" ]; then
if [ $MINGW -eq 0 ]; then
echo "0"
else

0 comments on commit 6d30002

Please sign in to comment.