sdlReportAssertion function

int sdlReportAssertion(
  1. Pointer<SdlAssertData> arg0,
  2. String? arg1,
  3. String? arg2,
  4. Pointer<NativeType> arg3,
)

this tells Clang's static analysis that we're a custom assert function, and that the analyzer should assume the condition was always true past this SDL_assert test. */

extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *, const char *, const char *, int) __attribute__((analyzer_noreturn))

Implementation

int sdlReportAssertion(Pointer<SdlAssertData> arg0, String? arg1, String? arg2,
    Pointer<NativeType> arg3) {
  final sdlReportAssertionLookupFunction = libSdl2.lookupFunction<
      Int32 Function(Pointer<SdlAssertData> arg0, Pointer<Utf8> arg1,
          Pointer<Utf8> arg2, Pointer<NativeType> arg3),
      int Function(Pointer<SdlAssertData> arg0, Pointer<Utf8> arg1,
          Pointer<Utf8> arg2, Pointer<NativeType> arg3)>('SDL_ReportAssertion');
  final arg1Pointer = arg1 != null ? arg1.toNativeUtf8() : nullptr;
  final arg2Pointer = arg2 != null ? arg2.toNativeUtf8() : nullptr;
  final result =
      sdlReportAssertionLookupFunction(arg0, arg1Pointer, arg2Pointer, arg3);
  calloc.free(arg1Pointer);
  calloc.free(arg2Pointer);
  return result;
}