Skip to content

Commit a2905d6

Browse files
authored
Merge branch 'libsdl-org:main' into main
2 parents b4dac5a + a23f974 commit a2905d6

File tree

72 files changed

+1737
-982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1737
-982
lines changed

CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,8 @@ if(SDL_LIBC)
11041104
check_symbol_exists(poll "poll.h" HAVE_POLL)
11051105
check_symbol_exists(memfd_create "sys/mman.h" HAVE_MEMFD_CREATE)
11061106
check_symbol_exists(posix_fallocate "fcntl.h" HAVE_POSIX_FALLOCATE)
1107+
check_symbol_exists(posix_spawn_file_actions_addchdir "spawn.h" HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)
1108+
check_symbol_exists(posix_spawn_file_actions_addchdir_np "spawn.h" HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP)
11071109

11081110
if(SDL_SYSTEM_ICONV)
11091111
check_c_source_compiles("
@@ -1979,6 +1981,7 @@ elseif(WINDOWS)
19791981
check_include_file(audioclient.h HAVE_AUDIOCLIENT_H)
19801982
check_include_file(sensorsapi.h HAVE_SENSORSAPI_H)
19811983
check_include_file(shellscalingapi.h HAVE_SHELLSCALINGAPI_H)
1984+
check_include_file(shobjidl_core.h HAVE_SHOBJIDL_CORE_H)
19821985
check_c_source_compiles("
19831986
#include <windows.h>
19841987
#include <mfapi.h>

android-project/app/proguard-rules.pro

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
int messageboxShowMessageBox(int, java.lang.String, java.lang.String, int[], int[], java.lang.String[], int[]);
3737
void minimizeWindow();
3838
boolean openURL(java.lang.String);
39-
void onNativePen(int, int, int , float , float , float);
4039
void requestPermission(java.lang.String, int);
4140
boolean showToast(java.lang.String, int, int, int, int);
4241
boolean sendMessage(int, int);

android-project/app/src/main/java/org/libsdl/app/SDLAudioManager.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ static void initialize() {
2626
@Override
2727
public void onAudioDevicesAdded(AudioDeviceInfo[] addedDevices) {
2828
for (AudioDeviceInfo deviceInfo : addedDevices) {
29-
addAudioDevice(deviceInfo.isSink(), deviceInfo.getProductName().toString(), deviceInfo.getId());
29+
nativeAddAudioDevice(deviceInfo.isSink(), deviceInfo.getProductName().toString(), deviceInfo.getId());
3030
}
3131
}
3232

3333
@Override
3434
public void onAudioDevicesRemoved(AudioDeviceInfo[] removedDevices) {
3535
for (AudioDeviceInfo deviceInfo : removedDevices) {
36-
removeAudioDevice(deviceInfo.isSink(), deviceInfo.getId());
36+
nativeRemoveAudioDevice(deviceInfo.isSink(), deviceInfo.getId());
3737
}
3838
}
3939
};
@@ -82,10 +82,10 @@ static void registerAudioDeviceCallback() {
8282
if (dev.getType() == AudioDeviceInfo.TYPE_TELEPHONY) {
8383
continue; // Device cannot be opened
8484
}
85-
addAudioDevice(dev.isSink(), dev.getProductName().toString(), dev.getId());
85+
nativeAddAudioDevice(dev.isSink(), dev.getProductName().toString(), dev.getId());
8686
}
8787
for (AudioDeviceInfo dev : audioManager.getDevices(AudioManager.GET_DEVICES_INPUTS)) {
88-
addAudioDevice(dev.isSink(), dev.getProductName().toString(), dev.getId());
88+
nativeAddAudioDevice(dev.isSink(), dev.getProductName().toString(), dev.getId());
8989
}
9090
audioManager.registerAudioDeviceCallback(mAudioDeviceCallback, null);
9191
}
@@ -119,8 +119,8 @@ static void audioSetThreadPriority(boolean recording, int device_id) {
119119

120120
static native int nativeSetupJNI();
121121

122-
static native void removeAudioDevice(boolean recording, int deviceId);
122+
static native void nativeRemoveAudioDevice(boolean recording, int deviceId);
123123

124-
static native void addAudioDevice(boolean recording, String name, int deviceId);
124+
static native void nativeAddAudioDevice(boolean recording, String name, int deviceId);
125125

126126
}

cmake/PreseedMSVCCache.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ if(MSVC)
1515
set(HAVE_MMDEVICEAPI_H "1" CACHE INTERNAL "Have include mmdeviceapi.h")
1616
set(HAVE_SENSORSAPI_H "1" CACHE INTERNAL "Have include sensorsapi.h")
1717
set(HAVE_SHELLSCALINGAPI_H "1" CACHE INTERNAL "Have include shellscalingapi.h")
18+
set(HAVE_SHOBJIDL_CORE_H "1" CACHE INTERNAL "Have include shobjidl_core.h")
1819
set(HAVE_TPCSHRD_H "1" CACHE INTERNAL "Have include tpcshrd.h")
1920
set(HAVE_WIN32_CC "1" CACHE INTERNAL "Test HAVE_WIN32_CC")
2021
set(HAVE_XINPUT_H "1" CACHE INTERNAL "Test HAVE_XINPUT_H")

docs/README-psp.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ cmake --install build
2929

3030

3131
## Compiling a HelloWorld
32-
[PSP Hello World](https://psp-dev.org/doku.php?id=tutorial:hello_world)
32+
[PSP Hello World](https://pspdev.github.io/basic_programs.html#hello-world)
3333

3434
## To Do
3535
- PSP Screen Keyboard

docs/README-wayland.md

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ encounter limitations or behavior that is different from other windowing systems
5959
`SDL_APP_ID` hint string, the desktop entry file name should match the application ID. For example, if your
6060
application ID is set to `org.my_org.sdl_app`, the desktop entry file should be named `org.my_org.sdl_app.desktop`.
6161

62+
### Keyboard grabs don't work when running under XWayland
63+
64+
- On GNOME based desktops, the dconf setting `org/gnome/mutter/wayland/xwayland-allow-grabs` must be enabled.
65+
6266
## Using custom Wayland windowing protocols with SDL windows
6367

6468
Under normal operation, an `SDL_Window` corresponds to an XDG toplevel window, which provides a standard desktop window.

docs/release_checklist.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
* Create a GitHub release and attach the archives you just generated.
1717

18+
* If this is a feature release, also tag the sdlwiki with the same tag.
19+
1820
## New feature release
1921

2022
* Update `WhatsNew.txt`

examples/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ add_sdl_example_executable(renderer-viewport SOURCES renderer/14-viewport/viewpo
136136
add_sdl_example_executable(renderer-cliprect SOURCES renderer/15-cliprect/cliprect.c DATAFILES ${CMAKE_CURRENT_SOURCE_DIR}/../test/sample.bmp)
137137
add_sdl_example_executable(renderer-read-pixels SOURCES renderer/17-read-pixels/read-pixels.c DATAFILES ${CMAKE_CURRENT_SOURCE_DIR}/../test/sample.bmp)
138138
add_sdl_example_executable(renderer-debug-text SOURCES renderer/18-debug-text/debug-text.c)
139+
add_sdl_example_executable(renderer-affine-textures SOURCES renderer/19-affine-textures/affine-textures.c DATAFILES ${CMAKE_CURRENT_SOURCE_DIR}/../test/sample.bmp)
139140
add_sdl_example_executable(audio-simple-playback SOURCES audio/01-simple-playback/simple-playback.c)
140141
add_sdl_example_executable(audio-simple-playback-callback SOURCES audio/02-simple-playback-callback/simple-playback-callback.c)
141142
add_sdl_example_executable(audio-load-wav SOURCES audio/03-load-wav/load-wav.c DATAFILES ${CMAKE_CURRENT_SOURCE_DIR}/../test/sample.wav)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This example creates an SDL window and renderer, and uses
2+
SDL_RenderTextureAffine to draw a 3D cube using only 2D rendering operations.
3+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
/* affine-textures.c ... */
2+
3+
/*
4+
* This example creates an SDL window and renderer, and then draws a cube
5+
* using affine-transformed textures every frame.
6+
*
7+
* This code is public domain. Feel free to use it for any purpose!
8+
*/
9+
10+
#define SDL_MAIN_USE_CALLBACKS 1 /* use the callbacks instead of main() */
11+
#include <SDL3/SDL.h>
12+
#include <SDL3/SDL_main.h>
13+
14+
/* We will use this renderer to draw into this window every frame. */
15+
static SDL_Window *window = NULL;
16+
static SDL_Renderer *renderer = NULL;
17+
static SDL_Texture *texture = NULL;
18+
static int texture_width = 0;
19+
static int texture_height = 0;
20+
21+
#define WINDOW_WIDTH 640
22+
#define WINDOW_HEIGHT 480
23+
24+
/* This function runs once at startup. */
25+
SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
26+
{
27+
SDL_Surface *surface = NULL;
28+
char *bmp_path = NULL;
29+
30+
SDL_SetAppMetadata("Example Renderer Affine Textures", "1.0", "com.example.renderer-affine-textures");
31+
32+
if (!SDL_Init(SDL_INIT_VIDEO)) {
33+
SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
34+
return SDL_APP_FAILURE;
35+
}
36+
37+
if (!SDL_CreateWindowAndRenderer("examples/renderer/affine-textures", WINDOW_WIDTH, WINDOW_HEIGHT, 0, &window, &renderer)) {
38+
SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
39+
return SDL_APP_FAILURE;
40+
}
41+
42+
/* Textures are pixel data that we upload to the video hardware for fast drawing. Lots of 2D
43+
engines refer to these as "sprites." We'll do a static texture (upload once, draw many
44+
times) with data from a bitmap file. */
45+
46+
/* SDL_Surface is pixel data the CPU can access. SDL_Texture is pixel data the GPU can access.
47+
Load a .bmp into a surface, move it to a texture from there. */
48+
SDL_asprintf(&bmp_path, "%ssample.bmp", SDL_GetBasePath()); /* allocate a string of the full file path */
49+
surface = SDL_LoadBMP(bmp_path);
50+
if (!surface) {
51+
SDL_Log("Couldn't load bitmap: %s", SDL_GetError());
52+
return SDL_APP_FAILURE;
53+
}
54+
55+
SDL_free(bmp_path); /* done with this, the file is loaded. */
56+
57+
texture_width = surface->w;
58+
texture_height = surface->h;
59+
60+
texture = SDL_CreateTextureFromSurface(renderer, surface);
61+
if (!texture) {
62+
SDL_Log("Couldn't create static texture: %s", SDL_GetError());
63+
return SDL_APP_FAILURE;
64+
}
65+
66+
SDL_DestroySurface(surface); /* done with this, the texture has a copy of the pixels now. */
67+
68+
return SDL_APP_CONTINUE; /* carry on with the program! */
69+
}
70+
71+
/* This function runs when a new event (mouse input, keypresses, etc) occurs. */
72+
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
73+
{
74+
if (event->type == SDL_EVENT_QUIT) {
75+
return SDL_APP_SUCCESS; /* end the program, reporting success to the OS. */
76+
}
77+
return SDL_APP_CONTINUE; /* carry on with the program! */
78+
}
79+
80+
/* This function runs once per frame, and is the heart of the program. */
81+
SDL_AppResult SDL_AppIterate(void *appstate)
82+
{
83+
const float x0 = 0.5f * WINDOW_WIDTH;
84+
const float y0 = 0.5f * WINDOW_HEIGHT;
85+
const float px = SDL_min(WINDOW_WIDTH, WINDOW_HEIGHT) / SDL_sqrtf(3.0f);
86+
87+
const Uint64 now = SDL_GetTicks();
88+
const float rad = (((float) ((int) (now % 2000))) / 2000.0f) * SDL_PI_F * 2;
89+
const float cos = SDL_cosf(rad);
90+
const float sin = SDL_sinf(rad);
91+
const float k[3] = { 3.0f / SDL_sqrtf(50.0f), 4.0f / SDL_sqrtf(50.0f), 5.0f / SDL_sqrtf(50.0f)};
92+
float mat[9] = {
93+
cos + (1.0f-cos)*k[0]*k[0], -sin*k[2] + (1.0f-cos)*k[0]*k[1], sin*k[1] + (1.0f-cos)*k[0]*k[2],
94+
sin*k[2] + (1.0f-cos)*k[0]*k[1], cos + (1.0f-cos)*k[1]*k[1], -sin*k[0] + (1.0f-cos)*k[1]*k[2],
95+
-sin*k[1] + (1.0f-cos)*k[0]*k[2], sin*k[0] + (1.0f-cos)*k[1]*k[2], cos + (1.0f-cos)*k[2]*k[2],
96+
};
97+
98+
float corners[16];
99+
int i;
100+
101+
for (i = 0; i < 8; i++) {
102+
const float x = (i & 1) ? -0.5f : 0.5f;
103+
const float y = (i & 2) ? -0.5f : 0.5f;
104+
const float z = (i & 4) ? -0.5f : 0.5f;
105+
corners[0 + 2*i] = mat[0]*x + mat[1]*y + mat[2]*z;
106+
corners[1 + 2*i] = mat[3]*x + mat[4]*y + mat[5]*z;
107+
}
108+
109+
SDL_SetRenderDrawColor(renderer, 0x42, 0x87, 0xf5, SDL_ALPHA_OPAQUE); // light blue background.
110+
SDL_RenderClear(renderer);
111+
112+
for (i = 1; i < 7; i++) {
113+
const int dir = 3 & ((i & 4) ? ~i : i);
114+
const int odd = (i & 1) ^ ((i & 2) >> 1) ^ ((i & 4) >> 2);
115+
if (0 < (odd ? 1.0f : -1.0f) * mat[5 + dir]) continue;
116+
int origin_index = (1 << ((dir - 1) % 3));
117+
int right_index = (1 << ((dir + odd) % 3)) | origin_index;
118+
int down_index = (1 << ((dir + (odd^1)) % 3)) | origin_index;
119+
if (!odd) {
120+
origin_index ^= 7;
121+
right_index ^= 7;
122+
down_index ^= 7;
123+
}
124+
SDL_FPoint origin, right, down;
125+
origin.x = x0 + px*corners[0 + 2*origin_index];
126+
origin.y = y0 + px*corners[1 + 2*origin_index];
127+
right.x = x0 + px*corners[0 + 2*right_index];
128+
right.y = y0 + px*corners[1 + 2*right_index];
129+
down.x = x0 + px*corners[0 + 2*down_index];
130+
down.y = y0 + px*corners[1 + 2*down_index];
131+
SDL_RenderTextureAffine(renderer, texture, NULL, &origin, &right, &down);
132+
}
133+
134+
SDL_RenderPresent(renderer);
135+
136+
return SDL_APP_CONTINUE;
137+
}
138+
139+
/* This function runs once at shutdown. */
140+
void SDL_AppQuit(void *appstate, SDL_AppResult result)
141+
{
142+
SDL_DestroyTexture(texture);
143+
/* SDL will clean up the window/renderer for us. */
144+
}
145+
Binary file not shown.
Loading

include/SDL3/SDL_process.h

+4
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ typedef enum SDL_ProcessIO
166166
* - `SDL_PROP_PROCESS_CREATE_ENVIRONMENT_POINTER`: an SDL_Environment
167167
* pointer. If this property is set, it will be the entire environment for
168168
* the process, otherwise the current environment is used.
169+
* - `SDL_PROP_PROCESS_CREATE_WORKING_DIRECTORY_STRING`: a UTF-8 encoded
170+
* string representing the working directory for the process, defaults to
171+
* the current working directory.
169172
* - `SDL_PROP_PROCESS_CREATE_STDIN_NUMBER`: an SDL_ProcessIO value describing
170173
* where standard input for the process comes from, defaults to
171174
* `SDL_PROCESS_STDIO_NULL`.
@@ -219,6 +222,7 @@ extern SDL_DECLSPEC SDL_Process * SDLCALL SDL_CreateProcessWithProperties(SDL_Pr
219222

220223
#define SDL_PROP_PROCESS_CREATE_ARGS_POINTER "SDL.process.create.args"
221224
#define SDL_PROP_PROCESS_CREATE_ENVIRONMENT_POINTER "SDL.process.create.environment"
225+
#define SDL_PROP_PROCESS_CREATE_WORKING_DIRECTORY_STRING "SDL.process.create.working_directory"
222226
#define SDL_PROP_PROCESS_CREATE_STDIN_NUMBER "SDL.process.create.stdin_option"
223227
#define SDL_PROP_PROCESS_CREATE_STDIN_POINTER "SDL.process.create.stdin_source"
224228
#define SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER "SDL.process.create.stdout_option"

include/SDL3/SDL_render.h

+55
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,21 @@ typedef enum SDL_TextureAccess
9898
SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */
9999
} SDL_TextureAccess;
100100

101+
/**
102+
* The addressing mode for a texture when used in SDL_RenderGeometry().
103+
*
104+
* This affects how texture coordinates are interpreted outside of [0, 1]
105+
*
106+
* \since This enum is available since SDL 3.4.0.
107+
*/
108+
typedef enum SDL_TextureAddressMode
109+
{
110+
SDL_TEXTURE_ADDRESS_INVALID = -1,
111+
SDL_TEXTURE_ADDRESS_AUTO, /**< Wrapping is enabled if texture coordinates are outside [0, 1], this is the default */
112+
SDL_TEXTURE_ADDRESS_CLAMP, /**< Texture coordinates are clamped to the [0, 1] range */
113+
SDL_TEXTURE_ADDRESS_WRAP, /**< The texture is repeated (tiled) */
114+
} SDL_TextureAddressMode;
115+
101116
/**
102117
* How the logical size is mapped to the output.
103118
*
@@ -2294,6 +2309,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_RenderTexture9GridTiled(SDL_Renderer *rende
22942309
* \since This function is available since SDL 3.2.0.
22952310
*
22962311
* \sa SDL_RenderGeometryRaw
2312+
* \sa SDL_SetRenderTextureAddressMode
22972313
*/
22982314
extern SDL_DECLSPEC bool SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer,
22992315
SDL_Texture *texture,
@@ -2326,6 +2342,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer,
23262342
* \since This function is available since SDL 3.2.0.
23272343
*
23282344
* \sa SDL_RenderGeometry
2345+
* \sa SDL_SetRenderTextureAddressMode
23292346
*/
23302347
extern SDL_DECLSPEC bool SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer,
23312348
SDL_Texture *texture,
@@ -2335,6 +2352,44 @@ extern SDL_DECLSPEC bool SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer,
23352352
int num_vertices,
23362353
const void *indices, int num_indices, int size_indices);
23372354

2355+
/**
2356+
* Set the texture addressing mode used in SDL_RenderGeometry().
2357+
*
2358+
* \param renderer the rendering context.
2359+
* \param u_mode the SDL_TextureAddressMode to use for horizontal texture
2360+
* coordinates in SDL_RenderGeometry().
2361+
* \param v_mode the SDL_TextureAddressMode to use for vertical texture
2362+
* coordinates in SDL_RenderGeometry().
2363+
* \returns true on success or false on failure; call SDL_GetError() for more
2364+
* information.
2365+
*
2366+
* \since This function is available since SDL 3.4.0.
2367+
*
2368+
* \sa SDL_RenderGeometry
2369+
* \sa SDL_RenderGeometryRaw
2370+
* \sa SDL_GetRenderTextureAddressMode
2371+
*/
2372+
extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderTextureAddressMode(SDL_Renderer *renderer, SDL_TextureAddressMode u_mode, SDL_TextureAddressMode v_mode);
2373+
2374+
/**
2375+
* Get the texture addressing mode used in SDL_RenderGeometry().
2376+
*
2377+
* \param renderer the rendering context.
2378+
* \param u_mode a pointer filled in with the SDL_TextureAddressMode to use
2379+
* for horizontal texture coordinates in SDL_RenderGeometry(),
2380+
* may be NULL.
2381+
* \param v_mode a pointer filled in with the SDL_TextureAddressMode to use
2382+
* for vertical texture coordinates in SDL_RenderGeometry(), may
2383+
* be NULL.
2384+
* \returns true on success or false on failure; call SDL_GetError() for more
2385+
* information.
2386+
*
2387+
* \since This function is available since SDL 3.4.0.
2388+
*
2389+
* \sa SDL_SetRenderTextureAddressMode
2390+
*/
2391+
extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderTextureAddressMode(SDL_Renderer *renderer, SDL_TextureAddressMode *u_mode, SDL_TextureAddressMode *v_mode);
2392+
23382393
/**
23392394
* Read pixels from the current rendering target.
23402395
*

include/SDL3/SDL_stdinc.h

+14-2
Original file line numberDiff line numberDiff line change
@@ -1299,8 +1299,11 @@ extern "C" {
12991299
*
13001300
* If `size` is 0, it will be set to 1.
13011301
*
1302-
* If you want to allocate memory aligned to a specific alignment, consider
1303-
* using SDL_aligned_alloc().
1302+
* If the allocation is successful, the returned pointer is guaranteed to be
1303+
* aligned to either the *fundamental alignment* (`alignof(max_align_t)` in
1304+
* C11 and later) or `2 * sizeof(void *)`, whichever is smaller. Use
1305+
* SDL_aligned_alloc() if you need to allocate memory aligned to an alignment
1306+
* greater than this guarantee.
13041307
*
13051308
* \param size the size to allocate.
13061309
* \returns a pointer to the allocated memory, or NULL if allocation failed.
@@ -1323,6 +1326,10 @@ extern SDL_DECLSPEC SDL_MALLOC void * SDLCALL SDL_malloc(size_t size);
13231326
*
13241327
* If either of `nmemb` or `size` is 0, they will both be set to 1.
13251328
*
1329+
* If the allocation is successful, the returned pointer is guaranteed to be
1330+
* aligned to either the *fundamental alignment* (`alignof(max_align_t)` in
1331+
* C11 and later) or `2 * sizeof(void *)`, whichever is smaller.
1332+
*
13261333
* \param nmemb the number of elements in the array.
13271334
* \param size the size of each element of the array.
13281335
* \returns a pointer to the allocated array, or NULL if allocation failed.
@@ -1357,6 +1364,11 @@ extern SDL_DECLSPEC SDL_MALLOC SDL_ALLOC_SIZE2(1, 2) void * SDLCALL SDL_calloc(s
13571364
* - If it returns NULL (indicating failure), then `mem` will remain valid and
13581365
* must still be freed with SDL_free().
13591366
*
1367+
* If the allocation is successfully resized, the returned pointer is
1368+
* guaranteed to be aligned to either the *fundamental alignment*
1369+
* (`alignof(max_align_t)` in C11 and later) or `2 * sizeof(void *)`,
1370+
* whichever is smaller.
1371+
*
13601372
* \param mem a pointer to allocated memory to reallocate, or NULL.
13611373
* \param size the new size of the memory.
13621374
* \returns a pointer to the newly allocated memory, or NULL if allocation

0 commit comments

Comments
 (0)