Skip to content

Commit

Permalink
Merge branch 'upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
Diordany committed Dec 16, 2024
2 parents be51be6 + e1f2d73 commit 5837946
Show file tree
Hide file tree
Showing 30 changed files with 791 additions and 77 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Linux CI
name: Linux

on: [push, pull_request]

jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-mac.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: macOS CI
name: macOS

on: [push, pull_request]

jobs:
build-mac-os:
name: Build macOS
runs-on: macos-12
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-mingw.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: MinGW CI
name: Windows (MinGW)

on: [push, pull_request]

jobs:
build-linux:
name: Build MinGW
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
name: Windows MSVC CI
name: Windows (MSVC)

on: [push, pull_request]

jobs:
build-windows:
name: Build Windows
runs-on: windows-2022
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
platform: [x64, Win32]

steps:
- uses: actions/checkout@v4

- uses: microsoft/setup-msbuild@v2

- name: Build ${{ matrix.platform }}
Expand Down
4 changes: 2 additions & 2 deletions MacOSX/QuakeSpasm.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,7 @@
"$(SRCROOT)",
"$(SRCROOT)/codecs/lib",
);
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_NAME = "$(TARGET_NAME)";
VALID_ARCHS = x86_64;
WRAPPER_EXTENSION = app;
Expand Down Expand Up @@ -1869,7 +1869,7 @@
"$(SRCROOT)",
"$(SRCROOT)/codecs/lib",
);
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_NAME = "$(TARGET_NAME)";
VALID_ARCHS = x86_64;
WRAPPER_EXTENSION = app;
Expand Down
2 changes: 2 additions & 0 deletions MacOSX/SDL2.framework/Versions/A/Headers/SDL_cpuinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ _m_prefetch(void *__P)
#ifndef __MMX__
#define __MMX__
#endif
/*
#ifndef __3dNOW__
#define __3dNOW__
#endif
*/
#endif
#ifndef __SSE__
#define __SSE__
Expand Down
13 changes: 11 additions & 2 deletions MacOSX/SDL2.framework/Versions/A/Headers/SDL_endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,16 @@ _m_prefetch(void *__P)
#ifdef __linux__
#include <endian.h>
#define SDL_BYTEORDER __BYTE_ORDER
#elif defined(__OpenBSD__)
#elif defined(__sun) && defined(__SVR4) /* Solaris */
#include <sys/byteorder.h>
#if defined(_LITTLE_ENDIAN)
#define SDL_BYTEORDER SDL_LIL_ENDIAN
#elif defined(_BIG_ENDIAN)
#define SDL_BYTEORDER SDL_BIG_ENDIAN
#else
#error Unsupported endianness
#endif
#elif defined(__OpenBSD__) || defined(__DragonFly__)
#include <endian.h>
#define SDL_BYTEORDER BYTE_ORDER
#elif defined(__FreeBSD__) || defined(__NetBSD__)
Expand All @@ -79,7 +88,7 @@ _m_prefetch(void *__P)
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
(defined(__MIPS__) && defined(__MIPSEB__)) || \
defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \
defined(__sparc__)
defined(__sparc__) || defined(__sparc)
#define SDL_BYTEORDER SDL_BIG_ENDIAN
#else
#define SDL_BYTEORDER SDL_LIL_ENDIAN
Expand Down
2 changes: 1 addition & 1 deletion MacOSX/SDL2.framework/Versions/A/Headers/SDL_revision.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#define SDL_REVISION "https://github.com/sezero/SDL.git@4217b3c97f36eaf44a9468c66b215e973905839f"
#define SDL_REVISION "https://github.com/sezero/SDL.git@b5fcddf2a00e8fafa25c66db19ce47b23ff11ba7"
#define SDL_REVISION_NUMBER 0
12 changes: 10 additions & 2 deletions MacOSX/SDL2.framework/Versions/A/Headers/SDL_stdinc.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ typedef uint64_t Uint64;
#ifndef SDL_PRIs64
#if defined(__WIN32__)
#define SDL_PRIs64 "I64d"
#elif defined(PRIs64)
#define SDL_PRIs64 PRIs64
#elif defined(PRId64)
#define SDL_PRIs64 PRId64
#elif defined(__LP64__) && !defined(__APPLE__)
#define SDL_PRIs64 "ld"
#else
Expand Down Expand Up @@ -706,6 +706,14 @@ size_t strlcpy(char* dst, const char* src, size_t size);
size_t strlcat(char* dst, const char* src, size_t size);
#endif

/* strdup is not ANSI but POSIX, and its prototype might be hidden... */
char *strdup(const char *str);

/* Starting LLVM 16, the analyser errors out if these functions do not have
their prototype defined (clang-diagnostic-implicit-function-declaration) */
#include <stdlib.h>
#include <string.h>

#define SDL_malloc malloc
#define SDL_calloc calloc
#define SDL_realloc realloc
Expand Down
4 changes: 4 additions & 0 deletions MacOSX/SDL2.framework/Versions/A/Headers/SDL_vulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ extern "C" {
VK_DEFINE_HANDLE(VkInstance)
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)

/* Make sure to undef to avoid issues in case of later vulkan include */
#undef VK_DEFINE_HANDLE
#undef VK_DEFINE_NON_DISPATCHABLE_HANDLE

#endif /* !NO_SDL_VULKAN_TYPEDEFS */

typedef VkInstance SDL_vulkanInstance;
Expand Down
2 changes: 1 addition & 1 deletion MacOSX/SDL2.framework/Versions/A/Headers/begin_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L)
#define SDL_FALLTHROUGH [[fallthrough]]
#else
#if defined(__has_attribute)
#if defined(__has_attribute) && !defined(__SUNPRO_C) && !defined(__SUNPRO_CC)
#define _HAS_FALLTHROUGH __has_attribute(__fallthrough__)
#else
#define _HAS_FALLTHROUGH 0
Expand Down
Binary file modified MacOSX/SDL2.framework/Versions/A/SDL2
Binary file not shown.
4 changes: 4 additions & 0 deletions Quake/bspfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

#define BSPVERSION 29

#ifdef BSP29_VALVE
#define BSPVERSION_VALVE 30
#endif

/* RMQ support (2PSB). 32bits instead of shorts for all but bbox sizes (which
* still use shorts) */
#define BSP2VERSION_2PSB (('B' << 24) | ('S' << 16) | ('P' << 8) | '2')
Expand Down
12 changes: 10 additions & 2 deletions Quake/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void Vec_Append (void **pvec, size_t element_size, const void *data, size_t coun
if (!count)
return;
Vec_Grow (pvec, element_size, count);
memcpy ((byte *)*pvec + VEC_HEADER(*pvec).size, data, count * element_size);
memcpy ((byte *)*pvec + VEC_HEADER(*pvec).size * element_size, data, count * element_size);
VEC_HEADER(*pvec).size += count;
}

Expand Down Expand Up @@ -294,6 +294,14 @@ char *q_strupr (char *str)
return str;
}

char *q_strdup (const char *str)
{
size_t len = strlen (str) + 1;
char *newstr = (char *)malloc (len);
memcpy (newstr, str, len);
return newstr;
}

/* platform dependant (v)snprintf function names: */
#if defined(_WIN32)
#define snprintf_func _snprintf
Expand Down Expand Up @@ -1138,7 +1146,7 @@ void COM_FileBase (const char *in, char *out, size_t outsize)
dot = NULL;
while (*s)
{
if (*s == '/')
if (*s == '/' || *s == '\\')
slash = s + 1;
if (*s == '.')
dot = s;
Expand Down
3 changes: 3 additions & 0 deletions Quake/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ extern char *q_strcasestr(const char *haystack, const char *needle);
extern char *q_strlwr (char *str);
extern char *q_strupr (char *str);

// strdup that calls malloc
extern char *q_strdup (const char *str);

/* snprintf, vsnprintf : always use our versions. */
extern int q_snprintf (char *str, size_t size, const char *format, ...) FUNC_PRINTF(3,4);
extern int q_vsnprintf(char *str, size_t size, const char *format, va_list args) FUNC_PRINTF(3,0);
Expand Down
Loading

0 comments on commit 5837946

Please sign in to comment.