sdlWcsdup function stdinc

Pointer<Int16> sdlWcsdup(
  1. Pointer<Int16> wstr
)

Allocate a copy of a wide string.

This allocates enough space for a null-terminated copy of wstr, using SDL_malloc, and then makes a copy of the string into this space.

The returned string is owned by the caller, and should be passed to SDL_free when no longer needed.

\param wstr the string to copy. \returns a pointer to the newly-allocated wide string.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL 3.2.0.

extern SDL_DECLSPEC wchar_t * SDLCALL SDL_wcsdup(const wchar_t *wstr)

Implementation

Pointer<Int16> sdlWcsdup(Pointer<Int16> wstr) {
  final sdlWcsdupLookupFunction = _libSdl
      .lookupFunction<
        Pointer<Int16> Function(Pointer<Int16> wstr),
        Pointer<Int16> Function(Pointer<Int16> wstr)
      >('SDL_wcsdup');
  return sdlWcsdupLookupFunction(wstr);
}