kill off MSVC support completely

delet michealsoft
psure this was broken since quite a long time, now since we use quite a bunch of GNU extensions (and actually rely on the cleanup attribute), supporting this in any way is just too much, so remove everything to declutter the codebase
This commit is contained in:
Alug committed 2025-09-24 21:24:40 +02:00
1 parent ea013709a3
commit f0a1896fdc
41 files changed
+11 -689

No files matched your search

+1
View File
@@ -98,6 +98,7 @@ Check the LUASTUFF file for more information on all the lua things Saturn has.
## Compiling
See [SRB2 Wiki/Source code compiling](http://wiki.srb2.org/wiki/Source_code_compiling). The compiling process for SRB2Kart is largely identical to SRB2.
Visual C++ (MSVC) is unsupported
## Disclaimer
Kart Krew is in no way affiliated with SEGA or Sonic Team. We do not claim ownership of any of SEGA's intellectual property used in SRB2.
-2
View File
@@ -23,11 +23,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef APNG_H
#define APNG_H
#ifndef _MSC_VER
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#endif
#ifndef _LFS64_LARGEFILE
#define _LFS64_LARGEFILE
-8
View File
@@ -46,10 +46,6 @@
** =======================================================
*/
#ifdef _MSC_VER
#pragma warning(disable : 4324)
#endif
/* chain list of long jump buffers */
struct lua_longjmp {
struct lua_longjmp *previous;
@@ -57,10 +53,6 @@ struct lua_longjmp {
volatile int status; /* error code */
};
#ifdef _MSC_VER
#pragma warning(default : 4324)
#endif
void luaD_seterrorobj (lua_State *L, int lerrcode, StkId oldtop) {
switch (lerrcode) {
case LUA_ERRMEM: {
-6
View File
@@ -48,12 +48,6 @@ LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize);
LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
LUAI_FUNC void luaD_growstack (lua_State *L, int n);
#ifdef _MSC_VER
#ifndef ATTRNORETURN
#define ATTRNORETURN __declspec(noreturn)
#endif
#endif
#ifndef ATTRNORETURN
#define ATTRNORETURN
#endif
-20
View File
@@ -11,12 +11,8 @@
#include <limits.h>
#include <stddef.h>
#ifdef _MSC_VER
#define INT32 __int32
#else
#include <stdint.h>
#define INT32 int32_t
#endif
#ifndef __cplusplus
#ifndef min // Double-Check with WATTCP-32's cdefs.h
@@ -570,9 +566,6 @@
#define luai_numshl(a,b) ((unsigned)(a)<<(unsigned)(b))
#define luai_numshr(a,b) ((unsigned)(a)>>(unsigned)(b))
#define luai_numnot(a) (~((unsigned)(a)))
#ifdef _MSC_VER
#pragma warning(disable : 4244)
#endif
#endif
@@ -589,24 +582,11 @@
#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \
(defined(__i386) || defined (_M_IX86) || defined(__i386__))
/* On a Microsoft compiler, use assembler */
#if defined(_MSC_VER)
#define lua_number2int(i,d) __asm fld d __asm fistp i
#define lua_number2integer(i,n) lua_number2int(i, n)
/* the next trick should work on any Pentium, but sometimes clashes
with a DirectX idiosyncrasy */
#else
union luai_Cast { double l_d; long l_l; };
#define lua_number2int(i,d) \
{ volatile union luai_Cast u; u.l_d = (d) + 6755399441055744.0; (i) = u.l_l; }
#define lua_number2integer(i,n) lua_number2int(i, n)
#endif
/* this option always works, but may be slow */
#else
#define lua_number2int(i,d) ((i)=(int)(d))
-16
View File
@@ -133,10 +133,6 @@ void Command_Droprate(void);
void Command_Numnodes(void);
#endif
#if defined(_MSC_VER)
#pragma pack(1)
#endif
// Client to server packet
typedef struct
{
@@ -176,10 +172,6 @@ typedef struct
ticcmd_t cmd, cmd2, cmd3, cmd4;
} ATTRPACK client4cmd_pak;
#ifdef _MSC_VER
#pragma warning(disable : 4200)
#endif
// Server to client packet
// this packet is too large
typedef struct
@@ -372,10 +364,6 @@ typedef struct {
UINT8 data[0]; // Size is variable using hardware_MAXPACKETLENGTH
} ATTRPACK filetx_pak;
#ifdef _MSC_VER
#pragma warning(default : 4200)
#endif
#define MAXAPPLICATION 16
typedef struct
@@ -519,10 +507,6 @@ typedef struct
} u; // This is needed to pack diff packet types data together
} ATTRPACK doomdata_t;
#if defined(_MSC_VER)
#pragma pack()
#endif
#define MAXSERVERLIST (MAXNETNODES-1)
typedef struct
{
+1 -1
View File
@@ -4679,7 +4679,7 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum)
return;
}
ncs = findfile(filename,md5sum,true);
ncs = findfile(filename, md5sum, true);
if (ncs != FS_FOUND || !P_AddWadFile(filename, false))
{
-16
View File
@@ -266,14 +266,6 @@ typedef enum
extern const char *netxcmdnames[MAXNETXCMD - 1];
#if defined(_MSC_VER)
#pragma pack(1)
#endif
#ifdef _MSC_VER
#pragma warning(disable : 4214)
#endif
//Packet composition for Command_TeamChange_f() ServerTeamChange, etc.
//bitwise structs make packing bits a little easier, but byte alignment harder?
//todo: decide whether to make the other netcommands conform, or just get rid of this experiment.
@@ -285,10 +277,6 @@ typedef struct {
UINT32 scrambled : 1; // value 0 to 1
} ATTRPACK changeteam_packet_t;
#ifdef _MSC_VER
#pragma warning(default : 4214)
#endif
typedef struct {
UINT16 l; // liitle endian
UINT16 b; // big enian
@@ -302,10 +290,6 @@ typedef union {
changeteam_value_t value;
} ATTRPACK changeteam_union;
#if defined(_MSC_VER)
#pragma pack()
#endif
// add game commands, needs cleanup
void D_RegisterServerCommands(void);
void D_RegisterClientCommands(void);
-8
View File
@@ -50,10 +50,6 @@ typedef enum
#define TICCMD_RECEIVED 1
#define TICCMD_XY 2
#if defined(_MSC_VER)
#pragma pack(1)
#endif
typedef struct
{
SINT8 forwardmove; // -MAXPLMOVE to MAXPLMOVE (50)
@@ -65,8 +61,4 @@ typedef struct
UINT8 latency; // Netgames: how many tics ago was this ticcmd generated from this player's end?
} ATTRPACK ticcmd_t;
#if defined(_MSC_VER)
#pragma pack()
#endif
#endif
-10
View File
@@ -54,8 +54,6 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#include <string.h>
#ifdef __GNUC__
#include <unistd.h>
#elif defined (_MSC_VER)
#include <direct.h>
#endif
#if defined (__unix__) || defined (UNIXCOMMON)
#include <fcntl.h>
@@ -66,10 +64,6 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#include <conio.h>
#endif
#ifdef _MSC_VER
#pragma warning(disable : 4214 4244)
#endif
#if defined (__unix__) || defined(__APPLE__) || (defined (UNIXCOMMON) && !defined (__HAIKU__))
#include <time.h>
#if defined (__linux__)
@@ -874,10 +868,6 @@ void I_OutputMsg(const char *fmt, ...)
DEFAULTFONTBGR, DEFAULTFONTBGG, DEFAULTFONTBGB, DEFAULTFONTBGA, txt);
#endif
#if defined (_WIN32) && defined (_MSC_VER)
OutputDebugStringA(txt);
#endif
len = strlen(txt);
#ifdef LOGMESSAGES
-8
View File
@@ -57,10 +57,6 @@ enum
// Do not use bit five or after, as they are used for object z-offsets.
#if defined(_MSC_VER)
#pragma pack(1)
#endif
// A single Vertex.
typedef struct
{
@@ -188,10 +184,6 @@ typedef struct
UINT16 children[2];
} ATTRPACK mapnode_t;
#if defined(_MSC_VER)
#pragma pack()
#endif
// Thing definition, position, orientation and type,
// plus visibility flags and attributes.
typedef struct
+1 -12
View File
@@ -47,17 +47,6 @@
#define ASMCALL
#endif
#ifdef _MSC_VER
#pragma warning(disable : 4127 4152 4213 4514)
#ifdef _WIN64
#pragma warning(disable : 4306)
#endif
#endif
// warning level 4
// warning C4127: conditional expression is constant
// warning C4152: nonstandard extension, function/data pointer conversion in expression
// warning C4213: nonstandard extension used : cast on l-value
#ifdef __cplusplus
extern "C" {
#endif
@@ -560,7 +549,7 @@ UINT32 quickncasehash (const char *p, size_t n)
#endif
#ifdef __cplusplus
#if defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER)
#if defined(__GNUC__) || defined(__clang__)
#define restrict __restrict
#else
#define restrict
+2 -44
View File
@@ -28,31 +28,6 @@ extern "C" {
#endif
/* 7.18.1.1 Exact-width integer types */
#ifdef _MSC_VER
#define UINT8 unsigned __int8
#define SINT8 signed __int8
#define UINT16 unsigned __int16
#define INT16 __int16
#define INT32 __int32
#define UINT32 unsigned __int32
#define INT64 __int64
#define UINT64 unsigned __int64
typedef long ssize_t;
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
#if (_MSC_VER <= 1200)
#ifndef DWORD_PTR
#define DWORD_PTR DWORD
#endif
#ifndef PDWORD_PTR
#define PDWORD_PTR PDWORD
#endif
#endif
#else
#define __STDC_LIMIT_MACROS
#include <stdint.h>
@@ -66,7 +41,6 @@ typedef long ssize_t;
#define UINT32 uint32_t
#define INT64 int64_t
#define UINT64 uint64_t
#endif
#ifdef __APPLE_CC__
#define DIRECTFULLSCREEN 1
@@ -76,16 +50,7 @@ typedef long ssize_t;
/* Strings and some misc platform specific stuff */
#if defined (_MSC_VER) || defined (__OS2__)
// Microsoft VisualC++
#ifdef _MSC_VER
#if (_MSC_VER <= 1800) // MSVC 2013 and back
#define snprintf _snprintf
#if (_MSC_VER <= 1200) // MSVC 6.0 and back
#define vsnprintf _vsnprintf
#endif
#endif
#endif
#if defined (__OS2__)
#define strncasecmp strnicmp
#define strcasecmp stricmp
#define inline __inline
@@ -270,13 +235,6 @@ typedef int32_t boolean;
#endif
#define ATTRUNUSED __attribute__((unused))
#elif defined (_MSC_VER)
#define ATTRNORETURN __declspec(noreturn)
#define ATTRINLINE __forceinline
#if _MSC_VER > 1200 // >= MSVC 6.0
#define ATTRNOINLINE __declspec(noinline)
#endif
#endif
#ifndef FUNCPRINTF
@@ -368,7 +326,7 @@ typedef UINT8 bitarray_t;
static inline int
in_bit_array (const bitarray_t * const array, const int value)
{
return (array[value >> 3] & (1<<(value & 7)));
return(array[value >> 3] & (1<<(value & 7)));
}
static inline void
+1 -280
View File
@@ -30,286 +30,7 @@
#include "z_zone.h"
#include "m_menu.h" // Addons_option_Onchange
#if defined (_WIN32) && defined (_MSC_VER)
#include <errno.h>
#include <io.h>
#include <tchar.h>
#define SUFFIX "*"
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#ifndef INVALID_FILE_ATTRIBUTES
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
#endif
struct dirent
{
long d_ino; /* Always zero. */
unsigned short d_reclen; /* Always zero. */
unsigned short d_namlen; /* Length of name in d_name. */
char d_name[FILENAME_MAX]; /* File name. */
};
/*
* This is an internal data structure. Good programmers will not use it
* except as an argument to one of the functions below.
* dd_stat field is now int (was short in older versions).
*/
typedef struct
{
/* disk transfer area for this dir */
struct _finddata_t dd_dta;
/* dirent struct to return from dir (NOTE: this makes this thread
* safe as long as only one thread uses a particular DIR struct at
* a time) */
struct dirent dd_dir;
/* _findnext handle */
#if _MSC_VER > 1200
intptr_t dd_handle;
#else
long dd_handle;
#endif
/*
* Status of search:
* 0 = not started yet (next entry to read is first entry)
* -1 = off the end
* positive = 0 based index of next entry
*/
int dd_stat;
/* given path for dir with search pattern (struct is extended) */
CHAR dd_name[1];
} DIR;
/*
* opendir
*
* Returns a pointer to a DIR structure appropriately filled in to begin
* searching a directory.
*/
DIR *
opendir (const CHAR *szPath)
{
DIR *nd;
DWORD rc;
CHAR szFullPath[MAX_PATH];
errno = 0;
if (!szPath)
{
errno = EFAULT;
return (DIR *) 0;
}
if (szPath[0] == '\0')
{
errno = ENOTDIR;
return (DIR *) 0;
}
/* Attempt to determine if the given path really is a directory. */
rc = GetFileAttributesA(szPath);
if (rc == INVALID_FILE_ATTRIBUTES)
{
/* call GetLastError for more error info */
errno = ENOENT;
return (DIR *) 0;
}
if (!(rc & FILE_ATTRIBUTE_DIRECTORY))
{
/* Error, entry exists but not a directory. */
errno = ENOTDIR;
return (DIR *) 0;
}
/* Make an absolute pathname. */
_fullpath (szFullPath, szPath, MAX_PATH);
/* Allocate enough space to store DIR structure and the complete
* directory path given. */
nd = (DIR *) malloc (sizeof (DIR) + (strlen(szFullPath) + strlen (SLASH) +
strlen(PATHSEP) + 1) * sizeof (CHAR));
if (!nd)
{
/* Error, out of memory. */
errno = ENOMEM;
return (DIR *) 0;
}
/* Create the search expression. */
strcpy (nd->dd_name, szFullPath);
/* Add on a slash if the path does not end with one. */
if (nd->dd_name[0] != '\0' &&
nd->dd_name[strlen (nd->dd_name) - 1] != PATHSEP[0])
{
strcat (nd->dd_name, PATHSEP);
}
/* Add on the search pattern */
strcat (nd->dd_name, SUFFIX);
/* Initialize handle to -1 so that a premature closedir doesn't try
* to call _findclose on it. */
nd->dd_handle = -1;
/* Initialize the status. */
nd->dd_stat = 0;
/* Initialize the dirent structure. ino and reclen are invalid under
* Win32, and name simply points at the appropriate part of the
* findfirst_t structure. */
nd->dd_dir.d_ino = 0;
nd->dd_dir.d_reclen = 0;
nd->dd_dir.d_namlen = 0;
ZeroMemory(nd->dd_dir.d_name, FILENAME_MAX);
return nd;
}
/*
* readdir
*
* Return a pointer to a dirent structure filled with the information on the
* next entry in the directory.
*/
struct dirent *
readdir (DIR * dirp)
{
errno = 0;
/* Check for valid DIR struct. */
if (!dirp)
{
errno = EFAULT;
return (struct dirent *) 0;
}
if (dirp->dd_stat < 0)
{
/* We have already returned all files in the directory
* (or the structure has an invalid dd_stat). */
return (struct dirent *) 0;
}
else if (dirp->dd_stat == 0)
{
/* We haven't started the search yet. */
/* Start the search */
dirp->dd_handle = _findfirst (dirp->dd_name, &(dirp->dd_dta));
if (dirp->dd_handle == -1)
{
/* Whoops! Seems there are no files in that
* directory. */
dirp->dd_stat = -1;
}
else
{
dirp->dd_stat = 1;
}
}
else
{
/* Get the next search entry. */
if (_findnext (dirp->dd_handle, &(dirp->dd_dta)))
{
/* We are off the end or otherwise error.
_findnext sets errno to ENOENT if no more file
Undo this. */
DWORD winerr = GetLastError();
if (winerr == ERROR_NO_MORE_FILES)
errno = 0;
_findclose (dirp->dd_handle);
dirp->dd_handle = -1;
dirp->dd_stat = -1;
}
else
{
/* Update the status to indicate the correct
* number. */
dirp->dd_stat++;
}
}
if (dirp->dd_stat > 0)
{
/* Successfully got an entry. Everything about the file is
* already appropriately filled in except the length of the
* file name. */
dirp->dd_dir.d_namlen = (unsigned short)strlen (dirp->dd_dta.name);
strcpy (dirp->dd_dir.d_name, dirp->dd_dta.name);
return &dirp->dd_dir;
}
return (struct dirent *) 0;
}
/*
* rewinddir
*
* Makes the next readdir start from the beginning.
*/
int
rewinddir (DIR * dirp)
{
errno = 0;
/* Check for valid DIR struct. */
if (!dirp)
{
errno = EFAULT;
return -1;
}
dirp->dd_stat = 0;
return 0;
}
/*
* closedir
*
* Frees up resources allocated by opendir.
*/
int
closedir (DIR * dirp)
{
int rc;
errno = 0;
rc = 0;
if (!dirp)
{
errno = EFAULT;
return -1;
}
if (dirp->dd_handle != -1)
{
rc = _findclose (dirp->dd_handle);
}
/* Delete the dir structure. */
free (dirp);
return rc;
}
#endif
static CV_PossibleValue_t addons_cons_t[] = {{0, "Default"},
#if 1
{1, "HOME"}, {2, "SRB2"},
#endif
{3, "CUSTOM"}, {0, NULL}};
static CV_PossibleValue_t addons_cons_t[] = {{0, "Default"}, {1, "HOME"}, {2, "SRB2"}, {3, "CUSTOM"}, {0, NULL}};
consvar_t cv_addons_option = {"addons_option", "Default", CV_SAVE|CV_CALL, addons_cons_t, Addons_option_Onchange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_addons_folder = {"addons_folder", "", CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
-8
View File
@@ -99,10 +99,6 @@ typedef struct
fixed_t x2, y2, z2;
} polyvertex_t;
#ifdef _MSC_VER
#pragma warning(disable : 4200)
#endif
// a convex 'plane' polygon, clockwise order
typedef struct
{
@@ -110,10 +106,6 @@ typedef struct
polyvertex_t pts[0];
} poly_t;
#ifdef _MSC_VER
#pragma warning(default : 4200)
#endif
// holds extra info for 3D render, for each subsector in subsectors[]
typedef struct
{
-8
View File
@@ -38,9 +38,6 @@
#define O_BINARY 0
#endif
#if defined(_MSC_VER)
#pragma pack(1)
#endif
typedef struct
{
UINT8 id_field_length ; // 1
@@ -54,9 +51,6 @@ typedef struct
UINT8 image_pix_size ; //17
UINT8 image_descriptor; //18
} ATTRPACK TGAHeader; // sizeof is 18
#if defined(_MSC_VER)
#pragma pack()
#endif
static UINT8 softwaretranstogl[11] = { 0, 25, 51, 76,102,127,153,178,204,229,255};
static UINT8 softwaretranstogl_hi[11] = { 0, 51,102,153,204,255,255,255,255,255,255};
@@ -1158,11 +1152,9 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
#ifdef HAVE_PNG
#ifndef _MSC_VER
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#endif
#ifndef _LFS64_LARGEFILE
#define _LFS64_LARGEFILE
-2
View File
@@ -47,11 +47,9 @@
#include "../v_video.h"
#ifdef HAVE_PNG
#ifndef _MSC_VER
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#endif
#ifndef _LFS64_LARGEFILE
#define _LFS64_LARGEFILE
-4
View File
@@ -22,10 +22,6 @@ extern "C" {
#include "hw_glob.h"
#include "hw_model.h"
#if defined(_MSC_VER)
#pragma pack()
#endif
typedef struct
{
char filename[32];
-8
View File
@@ -27,16 +27,8 @@ extern "C" {
#ifdef HAVE_SDL
#define _MATH_DEFINES_DEFINED
#ifdef _MSC_VER
#pragma warning(disable : 4214 4244)
#endif
#include "SDL_opengl.h" //Alam_GBC: Simple, yes?
#ifdef _MSC_VER
#pragma warning(default : 4214 4244)
#endif
#else
#include <GL/gl.h>
-4
View File
@@ -43,11 +43,7 @@
#ifndef I_getaddrinfo
#if !defined (_MSC_VER) || (_MSC_VER >= 1800) // MSVC 2013 and forward
#include <stdbool.h>
#else
typedef char bool;
#endif
#ifdef _WIN32
// it seems windows doesn't define that... maybe some other OS? OS/2
-8
View File
@@ -39,10 +39,6 @@ extern "C" {
extern INT16 hardware_MAXPACKETLENGTH;
#if defined(_MSC_VER)
#pragma pack(1)
#endif
typedef struct
{
/// Supposed to be DOOMCOM_ID
@@ -95,10 +91,6 @@ typedef struct
#define HOLEPUNCH_DATA(d) (holepunch_t *)&(d)->data
#endif
#if defined(_MSC_VER)
#pragma pack()
#endif
extern doomcom_t *doomcom;
/** \brief return packet in doomcom struct
-4
View File
@@ -25,10 +25,6 @@
#ifndef M_DLLIST_H__
#define M_DLLIST_H__
#ifdef _MSC_VER
#pragma warning(disable : 4706)
#endif
typedef struct mdllistitem_s
{
struct mdllistitem_s *next;
-8
View File
@@ -11,14 +11,6 @@
/// \file m_fixed.c
/// \brief Fixed point implementation
#if 0 //#ifndef NO_M
#include <math.h>
#define HAVE_SQRT
#if 0 //#ifndef _WIN32 // MSVCRT does not have *f() functions
#define HAVE_SQRTF
#endif
#endif
#include "doomdef.h"
#include "m_fixed.h"
#include "tables.h" // ANGLETOFINESHIFT
-2
View File
@@ -79,11 +79,9 @@ typedef off_t off64_t;
#ifdef HAVE_PNG
#ifndef _MSC_VER
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#endif
#ifndef _LFS64_LARGEFILE
#define _LFS64_LARGEFILE
-3
View File
@@ -20,9 +20,6 @@
#include <string.h>
#include <sys/types.h>
#ifdef _MSC_VER
#pragma warning(disable : 4127)
#endif
#if defined (STDC_HEADERS) || defined (_LIBC)
#include <stdlib.h>
+1 -9
View File
@@ -16,10 +16,6 @@
#include "i_threads.h"
#if defined(_MSC_VER)
#pragma pack(1)
#endif
typedef union
{
char buffer[16]; // information such as password
@@ -50,13 +46,9 @@ typedef struct
INT32 hostonly;
} ATTRPACK msg_ban_t;
#if defined(_MSC_VER)
#pragma pack()
#endif
// ================================ GLOBALS ===============================
#ifdef MASTERSERVER
extern consvar_t cv_masterserver;
extern consvar_t cv_masterserver;
#endif
extern consvar_t cv_servername;
extern consvar_t cv_server_contact;
-8
View File
@@ -52,10 +52,6 @@ mobj_t *skyboxmo[2];
// This must be updated whenever we up the max flat size - quicker to assume rather than figuring out the sqrt of the specific flat's filesize.
#define MAXFLATSIZE (2048<<FRACBITS)
#if defined(_MSC_VER)
#pragma pack(1)
#endif
/** Animated texture definition.
* Used for ::harddefs and for loading an ANIMATED lump from a wad.
*
@@ -73,10 +69,6 @@ typedef struct
INT32 speed ; ///< Number of tics for which each frame is shown.
} ATTRPACK animdef_t;
#if defined(_MSC_VER)
#pragma pack()
#endif
typedef struct
{
UINT32 count;
-9
View File
@@ -34,10 +34,6 @@
#include <malloc.h> // alloca(sizeof)
#endif
#if defined(_MSC_VER)
#pragma pack(1)
#endif
// Not sure if this is necessary, but it was in w_wad.c, so I'm putting it here too -Shadow Hog
#include <errno.h>
@@ -71,11 +67,6 @@ typedef struct
mappatch_t patches[1];
} ATTRPACK maptexture_t;
#if defined(_MSC_VER)
#pragma pack()
#endif
// Store lists of lumps for F_START/F_END etc.
typedef struct
{
-16
View File
@@ -576,10 +576,6 @@ typedef struct
UINT16 children[2];
} node_t;
#if defined(_MSC_VER)
#pragma pack(1)
#endif
// posts are runs of non masked source pixels
typedef struct
{
@@ -587,10 +583,6 @@ typedef struct
UINT8 length; // length data bytes follows
} ATTRPACK post_t;
#if defined(_MSC_VER)
#pragma pack()
#endif
// column_t is a list of 0 or more post_t, (UINT8)-1 terminated
typedef post_t column_t;
@@ -669,10 +661,6 @@ typedef struct
#endif
} patch_t;
#if defined(_MSC_VER)
#pragma pack(1)
#endif
typedef struct
{
INT16 width; // bounding box size
@@ -683,10 +671,6 @@ typedef struct
// the [0] is &columnofs[width]
} ATTRPACK softwarepatch_t;
#if defined(_MSC_VER)
#pragma pack()
#endif
// Possible alpha types for a patch.
enum patchalphastyle {AST_COPY, AST_TRANSLUCENT, AST_ADD, AST_SUBTRACT, AST_REVERSESUBTRACT, AST_MODULATE, AST_OVERLAY};
+1 -48
View File
@@ -92,7 +92,7 @@ if(${SDL2_FOUND})
source_group("Assembly" FILES ${SRB2_ASM_SOURCES} ${SRB2_NASM_SOURCES})
source_group("LUA" FILES ${SRB2_LUA_SOURCES} ${SRB2_LUA_HEADERS})
source_group("LUA\\Interpreter" FILES ${SRB2_BLUA_SOURCES} ${SRB2_BLUA_HEADERS})
if(${SRB2_CONFIG_HWRENDER})
set(SRB2_SDL2_TOTAL_SOURCES ${SRB2_SDL2_TOTAL_SOURCES}
@@ -110,16 +110,6 @@ if(${SDL2_FOUND})
set(SRB2_SDL2_TOTAL_SOURCES ${SRB2_SDL2_TOTAL_SOURCES}
${SRB2_NASM_SOURCES}
)
if(MSVC)
set(SRB2_SDL2_TOTAL_SOURCES ${SRB2_SDL2_TOTAL_SOURCES}
${SRB2_NASM_OBJECTS}
)
set_source_files_properties(${SRB2_NASM_OBJECTS} PROPERTIES GENERATED ON)
else()
list(APPEND SRB2_SDL2_TOTAL_SOURCES ${SRB2_ASM_SOURCES})
set_source_files_properties(${SRB2_ASM_SOURCES} PROPERTIES LANGUAGE C)
set_source_files_properties(${SRB2_ASM_SOURCES} PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp")
endif()
endif()
if(${CMAKE_SYSTEM} MATCHES Windows)
@@ -204,18 +194,6 @@ if(${SDL2_FOUND})
set(ASM_ASSEMBLER_OBJFORMAT ${CMAKE_ASM_NASM_OBJECT_FORMAT})
set_source_files_properties(${SRB2_NASM_SOURCES} LANGUAGE ASM_NASM)
endif()
if(MSVC)
# using assembler with msvc doesn't work, must do it manually
foreach(ASMFILE ${SRB2_NASM_SOURCES})
get_filename_component(ASMFILE_NAME ${ASMFILE} NAME_WE)
set(ASMFILE_NAME ${ASMFILE_NAME}.obj)
add_custom_command(TARGET SRB2SDL2 PRE_LINK
COMMAND ${ASM_ASSEMBLER_TEMP} ARGS -f ${ASM_ASSEMBLER_OBJFORMAT} -o ${CMAKE_CURRENT_BINARY_DIR}/${ASMFILE_NAME} ${ASMFILE}
COMMENT "assemble ${ASMFILE_NAME}."
)
endforeach()
endif()
endif()
if(${CMAKE_SYSTEM} MATCHES Windows)
@@ -227,31 +205,6 @@ if(${SDL2_FOUND})
)
endif()
if(MSVC)
if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES})
set(SDL2_MAIN_FOUND ON)
if(${SRB2_SYSTEM_BITS} EQUAL 64)
set(SDL2_MAIN_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/SDL2/x86_64-w64-mingw32/include/SDL2)
set(SDL2_MAIN_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDL2/x86_64-w64-mingw32/lib -lSDL2main")
else() # 32-bit
set(SDL2_MAIN_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/SDL2/i686-w64-mingw32/include/SDL2)
set(SDL2_MAIN_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDL2/i686-w64-mingw32/lib -lSDL2main")
endif()
else()
find_package(SDL2_MAIN REQUIRED)
endif()
target_link_libraries(SRB2SDL2 PRIVATE
${SDL2_MAIN_LIBRARIES}
)
target_compile_options(SRB2SDL2 PRIVATE
/Umain
/D_CRT_SECURE_NO_WARNINGS # something about string functions.
/D_CRT_NONSTDC_NO_DEPRECATE
/DSDLMAIN
/D_WINSOCK_DEPRECATED_NO_WARNINGS # Don't care
)
endif()
target_include_directories(SRB2SDL2 PRIVATE
${SDL2_INCLUDE_DIRS}
${SDL2_MIXER_INCLUDE_DIRS}
-8
View File
@@ -107,14 +107,6 @@ OutOfMemory(void)
return FALSE;
}
#if defined(_MSC_VER)
/* The VC++ compiler needs main/wmain defined */
# define console_ansi_main main
# if UNICODE
# define console_wmain wmain
# endif
#endif
/* WinMain, main, and wmain eventually call into here. */
static int
main_utf8(int argc, char *argv[])
-8
View File
@@ -25,18 +25,10 @@
#include "hwsym_sdl.h"
#include "../doomdef.h"
#ifdef _MSC_VER
#pragma warning(disable : 4214 4244)
#endif
#ifdef HAVE_SDL
#include "SDL.h"
#ifdef _MSC_VER
#pragma warning(default : 4214 4244)
#endif
#ifndef NOLOADSO
#include "SDL_loadso.h"
#endif
-14
View File
@@ -55,8 +55,6 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#include <string.h>
#ifdef __GNUC__
#include <unistd.h>
#elif defined (_MSC_VER)
#include <direct.h>
#endif
#if defined (__unix__) || defined (UNIXCOMMON)
#include <fcntl.h>
@@ -67,10 +65,6 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#include <conio.h>
#endif
#ifdef _MSC_VER
#pragma warning(disable : 4214 4244)
#endif
#ifdef HAVE_SDL
#define _MATH_DEFINES_DEFINED
#include "SDL.h"
@@ -79,10 +73,6 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#include "i_ttf.h"
#endif
#ifdef _MSC_VER
#pragma warning(default : 4214 4244)
#endif
#include "SDL_cpuinfo.h"
#define HAVE_SDLCPUINFO
@@ -975,10 +965,6 @@ void I_OutputMsg(const char *fmt, ...)
DEFAULTFONTBGR, DEFAULTFONTBGG, DEFAULTFONTBGB, DEFAULTFONTBGA, txt);
#endif
#if defined (_WIN32) && defined (_MSC_VER)
OutputDebugStringA(txt);
#endif
len = strlen(txt);
#ifdef LOGMESSAGES
-9
View File
@@ -24,19 +24,10 @@
#include <signal.h>
#ifdef _MSC_VER
#pragma warning(disable : 4214 4244)
#endif
#ifdef HAVE_SDL
#define _MATH_DEFINES_DEFINED
#include "SDL.h"
#ifdef _MSC_VER
#include <windows.h>
#pragma warning(default : 4214 4244)
#endif
#ifdef HAVE_TTF
#include "i_ttf.h"
#endif
-9
View File
@@ -11,11 +11,9 @@
#ifdef HAVE_LIBGME
#ifdef HAVE_ZLIB
#ifndef _MSC_VER
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#endif
#ifndef _LFS64_LARGEFILE
#define _LFS64_LARGEFILE
@@ -46,14 +44,7 @@ write netcode into the sound code, OKAY?
#include "../z_zone.h"
#include "../byteptr.h"
#ifdef _MSC_VER
#pragma warning(disable : 4214 4244)
#endif
#include "SDL.h"
#ifdef _MSC_VER
#pragma warning(default : 4214 4244)
#endif
#include "SDL_mixer.h"
/* This is the version number macro for the current SDL_mixer version: */
-8
View File
@@ -17,10 +17,6 @@
/// \file
/// \brief SDL specific part of the OpenGL API for SRB2
#ifdef _MSC_VER
#pragma warning(disable : 4214 4244)
#endif
#ifdef HAVE_SDL
#define _MATH_DEFINES_DEFINED
@@ -28,10 +24,6 @@
#include "sdlmain.h"
#ifdef _MSC_VER
#pragma warning(default : 4214 4244)
#endif
#include "../doomdef.h"
#include "../d_main.h"
+3 -19
View File
@@ -16,21 +16,14 @@
/// \file
/// \brief SDL interface for sound
#include <math.h>
#include "../doomdef.h"
#ifdef _MSC_VER
#pragma warning(disable : 4214 4244)
#endif
#if defined(HAVE_SDL) && SOUND == SOUND_SDL
#if defined(HAVE_SDL) && SOUND==SOUND_SDL
#include <math.h>
#include "SDL.h"
#ifdef _MSC_VER
#pragma warning(default : 4214 4244)
#endif
#ifdef HAVE_MIXER
#include <SDL_mixer.h>
/* This is the version number macro for the current SDL_mixer version: */
@@ -220,11 +213,6 @@ static inline Uint16 Snd_LowerRate(Uint16 sr)
return sr*2; // just keep it just above the output sample rate
}
#ifdef _MSC_VER
#pragma warning(disable : 4200)
#pragma pack(1)
#endif
typedef struct
{
Uint16 header; // 3?
@@ -234,11 +222,6 @@ typedef struct
Uint8 data[0]; // data;
} ATTRPACK dssfx_t;
#ifdef _MSC_VER
#pragma pack()
#pragma warning(default : 4200)
#endif
//
// This function loads the sound data from the WAD lump,
// for single sound.
@@ -1418,4 +1401,5 @@ static boolean I_StartGMESong(const char *musicname, boolean looping)
}
#endif
#endif
#endif //HAVE_SDL
-4
View File
@@ -29,11 +29,7 @@ extern SDL_bool framebuffer;
#include "../m_fixed.h"
// SDL2 stub macro
#ifdef _MSC_VER
#define SDL2STUB() CONS_Printf("SDL2: stubbed: %s:%d\n", __FUNCTION__, __LINE__)
#else
#define SDL2STUB() CONS_Printf("SDL2: stubbed: %s:%d\n", __func__, __LINE__)
#endif
// So m_menu knows whether to store cv_usejoystick value or string
#define JOYSTICK_HOTPLUG
-9
View File
@@ -12,11 +12,9 @@
/// \brief Handles WAD file header, directory, lump I/O
#ifdef HAVE_ZLIB
#ifndef _MSC_VER
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#endif
#ifndef _LFS64_LARGEFILE
#define _LFS64_LARGEFILE
@@ -577,10 +575,6 @@ static boolean ResFindSignature(FILE* handle, const char endPat[], UINT32 startp
return false;
}
#if defined(_MSC_VER)
#pragma pack(1)
#endif
typedef struct zend_s
{
char signature[4];
@@ -628,9 +622,6 @@ typedef struct zlentry_s
UINT16 namelen;
UINT16 xtralen;
} ATTRPACK zlentry_t;
#if defined(_MSC_VER)
#pragma pack()
#endif
/** Create a lumpinfo_t array for a PKZip file.
*/
-7
View File
@@ -32,19 +32,12 @@ extern "C" {
// a raw entry of the wad directory
// NOTE: This sits here and not in w_wad.c because p_setup.c makes use of it to load map WADs inside PK3s.
#if defined(_MSC_VER)
#pragma pack(1)
#endif
typedef struct
{
UINT32 filepos; // file offset of the resource
UINT32 size; // size of the resource
char name[8]; // name of the resource
} ATTRPACK filelump_t;
#if defined(_MSC_VER)
#pragma pack()
#endif
// ==============================================================
// WAD FILE STRUCTURE DEFINITIONS
-14
View File
@@ -602,24 +602,10 @@ LONG WINAPI RecordExceptionInfo(PEXCEPTION_POINTERS data/*, LPCSTR Message, LPST
#ifdef _X86_
#ifdef __GNUC__
__asm__("movl %%fs : 4, %%eax": "=a"(pStackTop));
#elif defined (_MSC_VER)
__asm
{
mov eax, fs:[4]
mov pStackTop, eax
}
#endif
#elif defined (_AMD64_)
#ifdef __GNUC__
__asm__("mov %%gs : 4, %%rax": "=a"(pStackTop));
#elif defined (_MSC_VER)
/*
__asm
{
mov rax, fs:[4]
mov pStackTop, rax
}
*/
#endif
#endif
if (pStackTop == NULL)