sdlMemcmp function

int sdlMemcmp(
  1. Pointer<NativeType> s1,
  2. Pointer<NativeType> s2,
  3. int len
)

Compare two buffers of memory.

\param s1 the first buffer to compare. NULL is not permitted! \param s2 the second buffer to compare. NULL is not permitted! \param len the number of bytes to compare between the buffers. \returns less than zero if s1 is "less than" s2, greater than zero if s1 is "greater than" s2, and zero if the buffers match exactly for len bytes.

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

\since This function is available since SDL 3.1.3.

extern SDL_DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len)

Implementation

int sdlMemcmp(Pointer<NativeType> s1, Pointer<NativeType> s2, int len) {
  final sdlMemcmpLookupFunction = libSdl3.lookupFunction<
      Int32 Function(
          Pointer<NativeType> s1, Pointer<NativeType> s2, Uint32 len),
      int Function(Pointer<NativeType> s1, Pointer<NativeType> s2,
          int len)>('SDL_memcmp');
  return sdlMemcmpLookupFunction(s1, s2, len);
}