Skip to content

Commit af3df8b

Browse files
committed
Review PHYSAC_NO_THREADS on WebAssembly
1 parent 02a5337 commit af3df8b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/physac.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,7 @@ static PolygonData CreateRectanglePolygon(Vector2 pos, Vector2 size)
10161016
// Physics loop thread function
10171017
static void *PhysicsLoop(void *arg)
10181018
{
1019+
#if !defined(PHYSAC_NO_THREADS)
10191020
#if defined(PHYSAC_DEBUG)
10201021
printf("[PHYSAC] physics thread created successfully\n");
10211022
#endif
@@ -1028,6 +1029,7 @@ static void *PhysicsLoop(void *arg)
10281029
{
10291030
RunPhysicsStep();
10301031
}
1032+
#endif
10311033

10321034
return NULL;
10331035
}
@@ -1905,7 +1907,7 @@ static void InitTimer(void)
19051907
QueryPerformanceFrequency((unsigned long long int *) &frequency);
19061908
#endif
19071909

1908-
#if defined(__linux__)
1910+
#if defined(__EMSCRIPTEN__) || defined(__linux__)
19091911
struct timespec now;
19101912
if (clock_gettime(CLOCK_MONOTONIC, &now) == 0) frequency = 1000000000;
19111913
#endif

0 commit comments

Comments
 (0)