Skip to content

Commit 7102ca7

Browse files
committed
Add macOS support for chunk handling in async functions
1 parent ac0c183 commit 7102ca7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

.DS_Store

4 KB
Binary file not shown.

src/terrain/chunk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ w_chunk *load_chunk_async(unsigned int position) {
2929
#if defined(WISPY_WINDOWS)
3030
chunk->handle = CreateThread(NULL, 0, chunk_thread, &ct, 0, NULL);
3131
if (chunk->handle == NULL || chunk->handle == INVALID_HANDLE_VALUE)
32-
#elif defined(WISPY_LINUX) || defined(WISPY_ANDROID)
32+
#elif defined(WISPY_LINUX) || defined(WISPY_ANDROID) || defined(WISPY_MACOS)
3333
if (pthread_create(&chunk->handle, NULL, chunk_thread, &ct) != 0)
3434
#endif
3535
{
@@ -65,7 +65,7 @@ void unload_chunk_async(w_chunk *chunk) {
6565
#if defined(WISPY_WINDOWS)
6666
chunk->handle = CreateThread(NULL, 0, chunk_thread, &ct, 0, NULL);
6767
if (chunk->handle == NULL || chunk->handle == INVALID_HANDLE_VALUE)
68-
#elif defined(WISPY_LINUX) || defined(WISPY_ANDROID)
68+
#elif defined(WISPY_LINUX) || defined(WISPY_ANDROID) || defined(WISPY_MACOS)
6969
if (pthread_create(&chunk->handle, NULL, chunk_thread, &ct) != 0)
7070
#endif
7171
{

src/terrain/chunk.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ typedef struct w_chunk {
99

1010
#if defined(WISPY_WINDOWS)
1111
HANDLE handle;
12-
#elif defined(WISPY_LINUX) || defined(WISPY_ANDROID)
12+
#elif defined(WISPY_LINUX) || defined(WISPY_ANDROID) || defined(WISPY_MACOS)
1313
pthread_t handle;
1414
#endif
1515

@@ -36,6 +36,6 @@ bool create_chunk_blocks(w_chunk* chunk);
3636

3737
#if defined(WISPY_WINDOWS)
3838
DWORD WINAPI chunk_thread(PVOID arg);
39-
#elif defined(WISPY_LINUX) || defined(WISPY_ANDROID)
39+
#elif defined(WISPY_LINUX) || defined(WISPY_ANDROID) || defined(WISPY_MACOS)
4040
void *chunk_thread(void *arg);
4141
#endif

0 commit comments

Comments
 (0)