sdlStrdup function
extern SDL_DECLSPEC SDL_MALLOC char * SDLCALL SDL_strdup(const char *str)
Implementation
Pointer<Int8> sdlStrdup(String? str) {
final sdlStrdupLookupFunction = libSdl3.lookupFunction<
Pointer<Int8> Function(Pointer<Utf8> str),
Pointer<Int8> Function(Pointer<Utf8> str)>('SDL_strdup');
final strPointer = str != null ? str.toNativeUtf8() : nullptr;
final result = sdlStrdupLookupFunction(strPointer);
calloc.free(strPointer);
return result;
}