Atlas - testsymbols.c
Home / ext / SDL / test Lines: 2 | Size: 3998 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1/* 2 Copyright (C) 1997-2026 Sam Lantinga <[email protected]> 3 4 This software is provided 'as-is', without any express or implied 5 warranty. In no event will the authors be held liable for any damages 6 arising from the use of this software. 7 8 Permission is granted to anyone to use this software for any purpose, 9 including commercial applications, and to alter it and redistribute it 10 freely. 11*/ 12 13/* Test for availability of ALL SDL3 symbols */ 14 15#define SDL_DISABLE_ANALYZE_MACROS 16 17#include <SDL3/SDL.h> 18#include <SDL3/SDL_main.h> 19#include <SDL3/SDL_vulkan.h> 20 21#if !defined(SDL_PLATFORM_ANDROID) 22extern SDL_DECLSPEC void SDLCALL SDL_GetAndroidActivity(void); 23extern SDL_DECLSPEC void SDLCALL SDL_GetAndroidCachePath(void); 24extern SDL_DECLSPEC void SDLCALL SDL_GetAndroidExternalStoragePath(void); 25extern SDL_DECLSPEC void SDLCALL SDL_GetAndroidExternalStorageState(void); 26extern SDL_DECLSPEC void SDLCALL SDL_GetAndroidInternalStoragePath(void); 27extern SDL_DECLSPEC void SDLCALL SDL_GetAndroidJNIEnv(void); 28extern SDL_DECLSPEC void SDLCALL SDL_GetAndroidSDKVersion(void); 29extern SDL_DECLSPEC void SDLCALL SDL_IsChromebook(void); 30extern SDL_DECLSPEC void SDLCALL SDL_IsDeXMode(void); 31extern SDL_DECLSPEC void SDLCALL SDL_RequestAndroidPermission(void); 32extern SDL_DECLSPEC void SDLCALL SDL_SendAndroidBackButton(void); 33extern SDL_DECLSPEC void SDLCALL SDL_SendAndroidMessage(void); 34extern SDL_DECLSPEC void SDLCALL SDL_ShowAndroidToast(void); 35#endif 36 37#if !defined(SDL_PLATFORM_GDK) 38extern SDL_DECLSPEC void SDLCALL SDL_GDKResumeGPU(void); 39extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendGPU(void); 40extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void); 41extern SDL_DECLSPEC void SDLCALL SDL_GetGDKDefaultUser(void); 42extern SDL_DECLSPEC void SDLCALL SDL_GetGDKTaskQueue(void); 43#endif 44 45#if !defined(SDL_PLATFORM_IOS) 46extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void); 47extern SDL_DECLSPEC void SDLCALL SDL_SetiOSAnimationCallback(void); 48extern SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(void); 49#endif 50 51#if !defined(SDL_PLATFORM_LINUX) 52extern SDL_DECLSPEC void SDLCALL SDL_SetLinuxThreadPriority(void); 53extern SDL_DECLSPEC void SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(void); 54#endif 55 56#if !(defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)) 57extern SDL_DECLSPEC void SDLCALL SDL_GetDXGIOutputInfo(void); 58extern SDL_DECLSPEC void SDLCALL SDL_GetDirect3D9AdapterIndex(void); 59#endif 60 61#if !defined(SDL_PLATFORM_WINDOWS) 62extern SDL_DECLSPEC void SDLCALL SDL_RegisterApp(void); 63extern SDL_DECLSPEC void SDLCALL SDL_UnregisterApp(void); 64extern SDL_DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(void); 65#endif 66 67extern SDL_DECLSPEC void SDLCALL JNI_OnLoad(void); 68 69#include <SDL3/SDL_openxr.h> 70 71static const struct { 72 const char *name; 73 SDL_FunctionPointer address; 74} sdl_symbols[] = { 75 #define SDL_DYNAPI_PROC(rc, fn, params, args, ret) { #fn, (SDL_FunctionPointer)fn }, 76 #include "../src/dynapi/SDL_dynapi_procs.h" 77 #undef SDL_DYNAPI_PROC 78 { NULL, NULL } 79}; 80 81static void print_usage(const char *argv0) 82{ 83 SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Usage: %s [number [number] ...]\n", argv0); 84} 85 86int main(int argc, char *argv[]) 87{ 88 static const int count_sdl_symbols = (int)SDL_arraysize(sdl_symbols) - 1; 89 int i; 90 int result = 0; 91 SDL_Log("There are %d SDL3 symbols", count_sdl_symbols); 92 for (i = 1; i < argc; i++) { 93 Sint64 symbol_index = -1; 94 char *endp = NULL; 95 symbol_index = (Sint64)SDL_strtol(argv[i], &endp, 10); 96 if (*endp != '\0') { 97 print_usage(argv[0]); 98 return 1; 99 } 100 if (symbol_index < 0 || symbol_index >= count_sdl_symbols) { 101 SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Index %" SDL_PRIs64 " is out of range", symbol_index); 102 result = 1; 103 continue; 104 } 105 SDL_Log("Address of %s is %p", sdl_symbols[symbol_index].name, sdl_symbols[symbol_index].address); 106 } 107 return result; 108} 109[FILE END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.