We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3781

Summary: unbalanced #pragma pack(pop) in close_code.h
Product: SDL Reporter: Ozkan Sezer <sezeroz>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: x86   
OS: All   

Description Ozkan Sezer 2017-08-28 09:56:05 UTC
Revision 288 (http://hg.libsdl.org/SDL/rev/2f5a6062db86) excluded the
Watcom compiler from forcing 4 byte structure packing in begin_code.h.
However, it missed updating close_code.h, which now has an unbalanced
#pragma pack(pop) if the compiler is Watcom.  The issue seems to have
crawled into SDL2, too.

The following patch upplies to both SDL-1.2 and SDL2: Please consider
applying to both.

diff -r 464908ca2d22 include/close_code.h
--- a/include/close_code.h	Sun Aug 27 19:03:15 2017 -0700
+++ b/include/close_code.h	Mon Aug 28 12:55:02 2017 +0300
@@ -32,7 +32,7 @@
  *  @file close_code.h
  *  Reset structure packing at previous byte alignment
  */
-#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__)  || defined(__BORLANDC__)
+#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
 #ifdef __BORLANDC__
 #pragma nopackwarning
 #endif
@@ -43,4 +43,3 @@
 #pragma pack(pop)
 #endif
 #endif /* Compiler needs structure packing set */
-
Comment 1 Ozkan Sezer 2017-08-28 10:02:50 UTC
SDL2 version of the patch that applies cleanly:

diff -r 464908ca2d22 include/close_code.h
--- a/include/close_code.h	Sun Aug 27 19:03:15 2017 -0700
+++ b/include/close_code.h	Mon Aug 28 12:55:02 2017 +0300
@@ -29,7 +29,7 @@
 #undef _begin_code_h
 
 /* Reset structure packing at previous byte alignment */
-#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__)  || defined(__BORLANDC__)
+#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
 #ifdef __BORLANDC__
 #pragma nopackwarning
 #endif