Skip to content

Commit

Permalink
Fixed FTBFS due to snprintf not existing under WIN32. Need to use _sn…
Browse files Browse the repository at this point in the history
…printf instead.
  • Loading branch information
danij committed Oct 17, 2007
1 parent d5df556 commit 1a4a3df
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 30 deletions.
13 changes: 8 additions & 5 deletions doomsday/engine/api/dd_share.h
Expand Up @@ -67,9 +67,10 @@ extern "C" {
char *strlwr(char *string);
#endif

// We need to use _vsnprintf in Windows
// We need to use _vsnprintf, _snprintf in Windows
#ifdef WIN32
# define vsnprintf(buf, size, fmt, list) _vsnprintf(buf, size, fmt, list)
# define snprintf(buf, size, fmt, list) _snprintf(buf, size, fmt, list)
#endif

// Format checking for printf-like functions in GCC2
Expand Down Expand Up @@ -109,8 +110,10 @@ extern "C" {
#define MIN_OF(x, y) ((x) < (y)? (x) : (y))
#define MINMAX_OF(a, x, b) ((x) < (a)? (a) : (x) > (b)? (b) : (x))
#define SIGN_OF(x) ((x) > 0? +1 : (x) < 0? -1 : 0)
#define ROUND(x) ((int) (((x) < 0.0f)? ((x) - 0.5f) : ((x) + 0.5f)))
#define ABS(x) ((x) >= 0 ? (x) : -(x))

// Used to replace /255 as *reciprocal255 is less expensive with CPU cycles.
// Used to replace /255 as *reciprocal255 is less expensive with CPU cycles.
// Note that this should err on the side of being < 1/255 to prevent result
// exceeding 255 (e.g. 255 * reciprocal255).
#define reciprocal255 0.003921568627f
Expand Down Expand Up @@ -920,7 +923,7 @@ enum { MX, MY, MZ }; // Momentum axis indices.
byte translucency; /* default = 0 = opaque */ \
short vistarget; /* -1 = mobj is becoming less visible, */ \
/* 0 = no change, 2= mobj is becoming more visible */ \
int reactiontime; /* if not zero, freeze controls */
int reactiontime; /* if not zero, freeze controls */

typedef struct ddmobj_base_s {
DD_BASE_MOBJ_ELEMENTS()} ddmobj_base_t;
Expand Down Expand Up @@ -1152,8 +1155,8 @@ typedef enum blendmode_e {
//
//------------------------------------------------------------------------

/*
* Tick Commands. Usually only a part of this data is transferred over
/*
* Tick Commands. Usually only a part of this data is transferred over
* the network. In addition to tick commands, clients will sent 'impulses'
* to the server when they want to change a weapon, use an artifact, or
* maybe commit suicide.
Expand Down
13 changes: 6 additions & 7 deletions doomsday/plugins/doom64tc/src/p_mobj.c
Expand Up @@ -3,12 +3,12 @@
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright © 2003-2007 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2005-2006 Daniel Swanson <danij@dengine.net>
*\author Copyright © 2003-2005 Samuel Villarreal <svkaiser@gmail.com>
*\author Copyright © 1999 by Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman (PrBoom 2.2.6)
*\author Copyright © 1999-2000 by Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze (PrBoom 2.2.6)
*\author Copyright © 1993-1996 by id Software, Inc.
*\author Copyright © 2003-2007 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2005-2007 Daniel Swanson <danij@dengine.net>
*\author Copyright © 2003-2005 Samuel Villarreal <svkaiser@gmail.com>
*\author Copyright © 1999 by Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman (PrBoom 2.2.6)
*\author Copyright © 1999-2000 by Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze (PrBoom 2.2.6)
*\author Copyright © 1993-1996 by id Software, Inc.
*
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -453,7 +453,6 @@ void P_ZMovement(mobj_t *mo)
delta = (mo->target->pos[VZ] + FLT2FIX(mo->target->height) / 2) -
(mo->pos[VZ] + FLT2FIX(mo->height) / 2);

#define ABS(x) ((x)<0?-(x):(x))
if(dist < mo->radius + mo->target->radius &&
ABS(delta) < FLT2FIX(mo->height + mo->target->height))
{
Expand Down
12 changes: 5 additions & 7 deletions doomsday/plugins/jdoom/src/p_mobj.c
Expand Up @@ -3,12 +3,11 @@
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright © 2003-2007 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2005-2006 Daniel Swanson <danij@dengine.net>
*\author Copyright © 1999 by Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman (PrBoom 2.2.6)
*\author Copyright © 1999-2000 by Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze (PrBoom 2.2.6)
*\author Copyright © 1993-1996 by id Software, Inc.
*
*\author Copyright © 2003-2007 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2005-2007 Daniel Swanson <danij@dengine.net>
*\author Copyright © 1999 by Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman (PrBoom 2.2.6)
*\author Copyright © 1999-2000 by Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze (PrBoom 2.2.6)
*\author Copyright © 1993-1996 by id Software, Inc.
*
* 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
Expand Down Expand Up @@ -435,7 +434,6 @@ void P_ZMovement(mobj_t *mo)
delta = (mo->target->pos[VZ] + FLT2FIX(mo->target->height /2)) -
(mo->pos[VZ] + FLT2FIX(mo->height /2));

#define ABS(x) ((x)<0?-(x):(x))
if(dist < mo->radius + mo->target->radius &&
ABS(delta) < FLT2FIX(mo->height + mo->target->height))
{
Expand Down
7 changes: 3 additions & 4 deletions doomsday/plugins/jheretic/src/p_mobj.c
Expand Up @@ -3,9 +3,9 @@
* License: Raven
* Online License Link: http://www.dengine.net/raven_license/End_User_License_Hexen_Source_Code.html
*
*\author Copyright © 2003-2007 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2005-2006 Daniel Swanson <danij@dengine.net>
*\author Copyright © 1999 Activision
*\author Copyright © 2003-2007 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2006 Daniel Swanson <danij@dengine.net>
*\author Copyright © 1999 Activision
*
* This program is covered by the HERETIC / HEXEN (LIMITED USE) source
* code license; you can redistribute it and/or modify it under the terms
Expand Down Expand Up @@ -574,7 +574,6 @@ void P_ZMovement(mobj_t *mo)
delta = (mo->target->pos[VZ] + FLT2FIX(mo->target->height /2)) -
(mo->pos[VZ] + FLT2FIX(mo->height /2));

#define ABS(x) ((x)<0?-(x):(x))
if(dist < mo->radius + mo->target->radius &&
ABS(delta) < FLT2FIX(mo->height + mo->target->height))
{
Expand Down
13 changes: 6 additions & 7 deletions doomsday/plugins/wolftc/src/p_mobj.c
Expand Up @@ -3,12 +3,12 @@
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright © 2003-2007 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2005-2006 Daniel Swanson <danij@dengine.net>
*\author Copyright © 2006 Martin Eyre <martineyre@btinternet.com>
*\author Copyright © 1999 by Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman (PrBoom 2.2.6)
*\author Copyright © 1999-2000 by Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze (PrBoom 2.2.6)
*\author Copyright © 1993-1996 by id Software, Inc.
*\author Copyright © 2003-2007 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2005-2007 Daniel Swanson <danij@dengine.net>
*\author Copyright © 2006 Martin Eyre <martineyre@btinternet.com>
*\author Copyright © 1999 by Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman (PrBoom 2.2.6)
*\author Copyright © 1999-2000 by Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze (PrBoom 2.2.6)
*\author Copyright © 1993-1996 by id Software, Inc.
*
* 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
Expand Down Expand Up @@ -433,7 +433,6 @@ void P_ZMovement(mobj_t *mo)
delta = (mo->target->pos[VZ] + FLT2FIX(mo->target->height/2)) -
(mo->pos[VZ] + FLT2FIX(mo->height /2));

#define ABS(x) ((x)<0?-(x):(x))
if(dist < mo->radius + mo->target->radius &&
ABS(delta) < FLT2FIX(mo->height + mo->target->height))
{
Expand Down

0 comments on commit 1a4a3df

Please sign in to comment.