Upgrade to 1.2.10 destroys program

My DOOM source port, the Eternity Engine, can no longer compile with SDL due
to repeated inclusions of the Visual C++ malloc.h header file from
"SDL_stdinc.h". It causes over 400 errors to occur on the declarations of
malloc, calloc, and free. This is up from zero errors when building with
1.2.7. It is also causing problems with the Small scripting engine because
apparently SDL also now defines its own int16_t and int32_t typedefs. I
don’t understand the purpose of these changes nor do I like SDL taking over
my program’s responsibilities and polluting the global namespace with
unneeded macros and typedefs.

Is there any way to work around this without rewriting thousands of lines of
my programs’ code? DOOM uses a custom heap but for convenience redefines
"malloc", “calloc”, and “free” to point to its own functions. I cannot
change this without modifying the entire game engine, and I’m just plain not
going to do it.

James Haley

Never mind, I was able to fix both problems by eliminating an SDL.h
inclusion that was leaking into the non-system-dependent code by having been
put into a header file. Still, including these kinds of things creates a
file inclusion order problem for SDL, and I wonder if it is not avoidable.
For example, if I include DOOM’s z_zone.h before SDL.h, it will break in
that module.

I may have another problem to write in about in a moment, but I have to test
my program with 1.2.10 first.

James Haley>From: “James Haley” <@James_Haley>

Reply-To: “A list for developers using the SDL library.
(includesSDL-announce)”
To: sdl at libsdl.org
Subject: [SDL] Upgrade to 1.2.10 destroys program.
Date: Sun, 28 May 2006 22:04:16 -0500
MIME-Version: 1.0
X-Originating-IP: [66.238.155.6]
X-Originating-Email: [@James_Haley]
X-Sender: @James_Haley
Received: from twomix.devolution.com ([206.58.251.131]) by
bay0-mc7-f1.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Sun, 28
May 2006 20:04:40 -0700
Received: from localhost([127.0.0.1] helo=twomix.devolution.com
ident=mailman)by twomix.devolution.com with esmtp (Exim 4.50)id
1FkY3b-0004Sv-MCfor @James_Haley; Sun, 28 May 2006 20:04:39 -0700
Received: from bay104-f2.bay104.hotmail.com ([65.54.175.12]
helo=hotmail.com)by twomix.devolution.com with esmtp (Exim 4.50) id
1FkY3I-0004Nm-Kffor sdl at libsdl.org; Sun, 28 May 2006 20:04:20 -0700
Received: from mail pickup service by hotmail.com with Microsoft
SMTPSVC;Sun, 28 May 2006 20:04:16 -0700
Received: from 65.54.175.200 by by104fd.bay104.hotmail.msn.com with
HTTP;Mon, 29 May 2006 03:04:16 GMT
X-Message-Info: LsUYwwHHNt3660MmjhEvYg2f34OAemlK+3Wz9fWrJ/U=
X-OriginalArrivalTime: 29 May 2006 03:04:16.0678
(UTC)FILETIME=[92576C60:01C682CC]
X-Virus-Scanner: Scanned by CLAMAV on devolution.com
X-BeenThere: sdl at libsdl.org
X-Mailman-Version: 2.1.7
Precedence: list
List-Id: “A list for developers using the SDL library.
(includesSDL-announce)” <sdl.libsdl.org>
List-Unsubscribe:
http://www.libsdl.org/mailman/listinfo/sdl,<mailto:sdl-request at libsdl.org?subject=unsubscribe>
List-Archive: http://www.libsdl.org/pipermail/sdl
List-Post: <mailto:sdl at libsdl.org>
List-Help: <mailto:sdl-request at libsdl.org?subject=help>
List-Subscribe:
http://www.libsdl.org/mailman/listinfo/sdl,<mailto:sdl-request at libsdl.org?subject=subscribe>
Errors-To: sdl-bounces+haleyjd=hotmail.com at libsdl.org
X-Virus-Scanner: Scanned by CLAMAV on devolution.com
Return-Path: sdl-bounces+haleyjd=hotmail.com at libsdl.org

My DOOM source port, the Eternity Engine, can no longer compile with SDL
due
to repeated inclusions of the Visual C++ malloc.h header file from
"SDL_stdinc.h". It causes over 400 errors to occur on the declarations of
malloc, calloc, and free. This is up from zero errors when building with
1.2.7. It is also causing problems with the Small scripting engine because
apparently SDL also now defines its own int16_t and int32_t typedefs. I
don’t understand the purpose of these changes nor do I like SDL taking over
my program’s responsibilities and polluting the global namespace with
unneeded macros and typedefs.

Is there any way to work around this without rewriting thousands of lines
of
my programs’ code? DOOM uses a custom heap but for convenience redefines
"malloc", “calloc”, and “free” to point to its own functions. I cannot
change this without modifying the entire game engine, and I’m just plain
not
going to do it.

James Haley


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl