# SDL: Fixed stdlib\_usage check

**URL:** <https://discourse.libsdl.org/t/sdl-fixed-stdlib-usage-check/69734>\
**Category:** SDL Commits\
**Created:** [November 2, 2026, 10:19pm UTC](https://discourse.libsdl.org/t/sdl-fixed-stdlib-usage-check/69734 "2026-11-02T22:19:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [November 2, 2026, 10:19pm UTC](https://discourse.libsdl.org/t/sdl-fixed-stdlib-usage-check/69734/1 "2026-11-02T22:19:36Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/0e4eed028281f073524ff5d269164763bed97228>
>
> (cherry picked from commit 8f183e14134fe5ee5abc39d76a2600cfb149a606)

```diff
From 0e4eed028281f073524ff5d269164763bed97228 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 2 Nov 2026 14:16:04 -0800
Subject: [PATCH] Fixed stdlib_usage check

(cherry picked from commit 8f183e14134fe5ee5abc39d76a2600cfb149a606)
---
 src/SDL.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/SDL.c b/src/SDL.c
index f8eb1d048c346..8354bd5de79a1 100644
--- a/src/SDL.c
+++ b/src/SDL.c
@@ -347,7 +347,7 @@ bool SDL_InitSubSystem(SDL_InitFlags flags)
         if (typeof(SDL3.CPtrToHeap32Index) === 'undefined') { SDL3.CPtrToHeap32Index = function(ptr) { return ptr >>> 2; }; }
         #elif defined( __wasm64__ )
         if (typeof(SDL3.JSVarToCPtr) === 'undefined') { SDL3.JSVarToCPtr = function(v) { return BigInt(v); }; }
- if (typeof(SDL3.CPtrToHeap32Index) === 'undefined') { SDL3.CPtrToHeap32Index = function(ptr) { return Math.floor(Number(ptr) / 4); }; }
+ if (typeof(SDL3.CPtrToHeap32Index) === 'undefined') { SDL3.CPtrToHeap32Index = function(ptr) { return Math.floor(Number(ptr) / 4); }; } // This should NOT be SDL_floor()
         #else
         #error Please define your platform.
         #endif

```
