Skip to content

Commit 619d5b7

Browse files
committed
Deal with compiler changes on Windows giving different bitfield padding
1 parent 191a694 commit 619d5b7

File tree

16 files changed

+173
-12
lines changed

16 files changed

+173
-12
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,6 @@ Jul 2019 (v5.1.2)
9595

9696
Aug 2019 (v5.1.3)
9797
* Print QJST SLPTU as number not timestamp
98+
99+
Aug 2019 (v5.1.4)
100+
* Newer compilers have changed bitfield structure padding layouts

bin/aix/convH

791 Bytes
Binary file not shown.

bin/aix/mqsmfcsv

3.71 KB
Binary file not shown.

bin/linux/convH

3.98 KB
Binary file not shown.

bin/linux/mqsmfcsv

7.69 KB
Binary file not shown.

bin/win/convH.exe

-9.99 KB
Binary file not shown.

bin/win/mqsmfcsv.exe

322 KB
Binary file not shown.

src/M

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ plat=`uname`
44

55
if [ "$plat" = "AIX" ]
66
then
7-
flags="-q32 -qmaxmem=-1 $CCEXTRAFLAGS"
7+
flags="-q32 -qmaxmem=-1 $CCEXTRAFLAGS -D PLATFORM_AIX"
88
cc="xlc"
99
targdir="../bin/aix"
1010
optim="-O3"
1111
else
12-
flags="-m32 $CCEXTRAFLAGS"
12+
flags="-m32 $CCEXTRAFLAGS -D PLATFORM_LINUX"
1313
cc="gcc"
1414
targdir="../bin/linux"
1515
optim="-O3"

src/Makefile.gcc.win

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
CC=i686-w64-mingw32-gcc
3-
CFLAGS= -I. -m32 -O2
3+
CFLAGS= -I. -m32 -fpack-struct=1 -DPLATFORM_WINDOWS
44
PLATFLAGS=
55
VERS=913
66
SRC = mqsmf.c \
@@ -9,6 +9,7 @@ SRC = mqsmf.c \
99
smfConv.c \
1010
smfJson.c \
1111
smfPrint.c \
12+
checkSize.c \
1213
printDEBUG.c \
1314
printQ5ST.c \
1415
printQCST.c \
@@ -38,6 +39,11 @@ SRC = mqsmf.c \
3839
HDR = mqsmfstruc.h \
3940
mqsmf.h
4041

42+
checkSize: mqsmfcsv.exe
43+
./mqsmfcsv.exe -v > sizes.tmp
44+
diff -b sizes.tmp sizes.master
45+
46+
4147
mqsmfcsv.exe: $(SRC) $(HDR) Makefile.gcc.win dummy
4248
-rm -f $@
4349
$(CC) $(PLATFLAGS) -o $@ $(SRC) $(CFLAGS) -DCSQDSMF_VERSION=$(VERS)
@@ -48,7 +54,7 @@ mqsmfstruc.h: csqdsmfc-$(VERS).h convH.exe dummy
4854
./convH.exe < csqdsmfc-$(VERS).h > $@
4955

5056
convH.exe: convH.c
51-
$(CC) -o $@ convH.c
57+
$(CC) $(CFLAGS) -o $@ convH.c
5258
cp $@ ../bin/win
5359

5460

src/Makefile.unix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ SRC = \
88
smfDate.c \
99
smfConv.c \
1010
smfJson.c \
11+
checkSize.c \
1112
printDEBUG.c \
1213
printQ5ST.c \
1314
printQCST.c \
@@ -38,6 +39,10 @@ SRC = \
3839
HDR = mqsmfstruc.h \
3940
mqsmf.h
4041

42+
checkSize: mqsmfcsv
43+
./mqsmfcsv -v > sizes.tmp
44+
diff -b sizes.tmp sizes.master
45+
4146
mqsmfcsv: $(SRC) $(HDR) Makefile.unix dummy
4247
$(CC) $(PLATFLAGS) -o $@ $(SRC) $(CFLAGS) -DCSQDSMF_VERSION=$(VERS)
4348

0 commit comments

Comments
 (0)