SDL_dynapi.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2022 Sam Lantinga <[email protected]>
  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. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. #ifndef SDL_dynapi_h_
  19. #define SDL_dynapi_h_
  20. /* IMPORTANT:
  21. This is the master switch to disabling the dynamic API. We made it so you
  22. have to hand-edit an internal source file in SDL to turn it off; you
  23. can do it if you want it badly enough, but hopefully you won't want to.
  24. You should understand the ramifications of turning this off: it makes it
  25. hard to update your SDL in the field, and impossible if you've statically
  26. linked SDL into your app. Understand that platforms change, and if we can't
  27. drop in an updated SDL, your application can definitely break some time
  28. in the future, even if it's fine today.
  29. To be sure, as new system-level video and audio APIs are introduced, an
  30. updated SDL can transparently take advantage of them, but your program will
  31. not without this feature. Think hard before turning it off.
  32. */
  33. #ifdef SDL_DYNAMIC_API /* Tried to force it on the command line? */
  34. #error Nope, you have to edit this file to force this off.
  35. #endif
  36. #ifdef __APPLE__
  37. #include "TargetConditionals.h"
  38. #endif
  39. #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE /* probably not useful on iOS. */
  40. #define SDL_DYNAMIC_API 0
  41. #elif defined(__native_client__) && __native_client__ /* probably not useful on NACL. */
  42. #define SDL_DYNAMIC_API 0
  43. #elif defined(__EMSCRIPTEN__) && __EMSCRIPTEN__ /* probably not useful on Emscripten. */
  44. #define SDL_DYNAMIC_API 0
  45. #elif defined(SDL_BUILDING_WINRT) && SDL_BUILDING_WINRT /* probably not useful on WinRT, given current .dll loading restrictions */
  46. #define SDL_DYNAMIC_API 0
  47. #elif defined(__PSP__) && __PSP__
  48. #define SDL_DYNAMIC_API 0
  49. #elif defined(__riscos__) && __riscos__ /* probably not useful on RISC OS, since dlopen() can't be used when using static linking. */
  50. #define SDL_DYNAMIC_API 0
  51. #elif defined(__clang_analyzer__)
  52. #define SDL_DYNAMIC_API 0 /* Turn off for static analysis, so reports are more clear. */
  53. #elif defined(__VITA__)
  54. #define SDL_DYNAMIC_API 0 /* vitasdk doesn't support dynamic linking */
  55. #elif defined(__NGAGE__)
  56. #define SDL_DYNAMIC_API 0 /* The N-Gage doesn't support dynamic linking either */
  57. #elif defined(DYNAPI_NEEDS_DLOPEN) && !defined(HAVE_DLOPEN)
  58. #define SDL_DYNAMIC_API 0 /* we need dlopen(), but don't have it.... */
  59. #endif
  60. /* everyone else. This is where we turn on the API if nothing forced it off. */
  61. #ifndef SDL_DYNAMIC_API
  62. #define SDL_DYNAMIC_API 1
  63. #endif
  64. #endif
  65. /* vi: set ts=4 sw=4 expandtab: */