🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
4.3 KiB

  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
  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_internal_h_
  19. #define SDL_internal_h_
  20. /* Many of SDL's features require _GNU_SOURCE on various platforms */
  21. #ifndef _GNU_SOURCE
  22. #define _GNU_SOURCE
  23. #endif
  24. /* This is for a variable-length array at the end of a struct:
  25. struct x { int y; char z[SDL_VARIABLE_LENGTH_ARRAY]; };
  26. Use this because GCC 2 needs different magic than other compilers. */
  27. #if (defined(__GNUC__) && (__GNUC__ <= 2)) || defined(__CC_ARM) || defined(__cplusplus)
  28. #define SDL_VARIABLE_LENGTH_ARRAY 1
  29. #else
  30. #define SDL_VARIABLE_LENGTH_ARRAY
  31. #endif
  32. #define SDL_MAX_SMALL_ALLOC_STACKSIZE 128
  33. #define SDL_small_alloc(type, count, pisstack) ( (*(pisstack) = ((sizeof(type)*(count)) < SDL_MAX_SMALL_ALLOC_STACKSIZE)), (*(pisstack) ? SDL_stack_alloc(type, count) : (type*)SDL_malloc(sizeof(type)*(count))) )
  34. #define SDL_small_free(ptr, isstack) if ((isstack)) { SDL_stack_free(ptr); } else { SDL_free(ptr); }
  35. #include "dynapi/SDL_dynapi.h"
  36. #if SDL_DYNAMIC_API
  37. #include "dynapi/SDL_dynapi_overrides.h"
  38. /* force DECLSPEC and SDLCALL off...it's all internal symbols now.
  39. These will have actual #defines during SDL_dynapi.c only */
  40. #define DECLSPEC
  41. #define SDLCALL
  42. #endif
  43. #include "SDL_config.h"
  44. /* If you run into a warning that O_CLOEXEC is redefined, update the SDL configuration header for your platform to add HAVE_O_CLOEXEC */
  45. #ifndef HAVE_O_CLOEXEC
  46. #define O_CLOEXEC 0
  47. #endif
  48. /* A few #defines to reduce SDL2 footprint.
  49. Only effective when library is statically linked.
  50. You have to manually edit this file. */
  51. #ifndef SDL_LEAN_AND_MEAN
  52. #define SDL_LEAN_AND_MEAN 0
  53. #endif
  54. /* Optimized functions from 'SDL_blit_0.c'
  55. - blit with source BitsPerPixel < 8, palette */
  56. #ifndef SDL_HAVE_BLIT_0
  57. #define SDL_HAVE_BLIT_0 !SDL_LEAN_AND_MEAN
  58. #endif
  59. /* Optimized functions from 'SDL_blit_1.c'
  60. - blit with source BytesPerPixel == 1, palette */
  61. #ifndef SDL_HAVE_BLIT_1
  62. #define SDL_HAVE_BLIT_1 !SDL_LEAN_AND_MEAN
  63. #endif
  64. /* Optimized functions from 'SDL_blit_A.c'
  65. - blit with 'SDL_BLENDMODE_BLEND' blending mode */
  66. #ifndef SDL_HAVE_BLIT_A
  67. #define SDL_HAVE_BLIT_A !SDL_LEAN_AND_MEAN
  68. #endif
  69. /* Optimized functions from 'SDL_blit_N.c'
  70. - blit with COLORKEY mode, or nothing */
  71. #ifndef SDL_HAVE_BLIT_N
  72. #define SDL_HAVE_BLIT_N !SDL_LEAN_AND_MEAN
  73. #endif
  74. /* Optimized functions from 'SDL_blit_N.c'
  75. - RGB565 conversion with Lookup tables */
  76. #ifndef SDL_HAVE_BLIT_N_RGB565
  77. #define SDL_HAVE_BLIT_N_RGB565 !SDL_LEAN_AND_MEAN
  78. #endif
  79. /* Optimized functions from 'SDL_blit_AUTO.c'
  80. - blit with modulate color, modulate alpha, any blending mode
  81. - scaling or not */
  82. #ifndef SDL_HAVE_BLIT_AUTO
  83. #define SDL_HAVE_BLIT_AUTO !SDL_LEAN_AND_MEAN
  84. #endif
  85. /* Run-Length-Encoding
  86. - SDL_SetColorKey() called with SDL_RLEACCEL flag */
  87. #ifndef SDL_HAVE_RLE
  88. #define SDL_HAVE_RLE !SDL_LEAN_AND_MEAN
  89. #endif
  90. /* Software SDL_Renderer
  91. - creation of software renderer
  92. - *not* general blitting functions
  93. - {blend,draw}{fillrect,line,point} internal functions */
  94. #ifndef SDL_VIDEO_RENDER_SW
  95. #define SDL_VIDEO_RENDER_SW !SDL_LEAN_AND_MEAN
  96. #endif
  97. /* YUV formats
  98. - handling of YUV surfaces
  99. - blitting and conversion functions */
  100. #ifndef SDL_HAVE_YUV
  101. #define SDL_HAVE_YUV !SDL_LEAN_AND_MEAN
  102. #endif
  103. #include "SDL_assert.h"
  104. #include "SDL_log.h"
  105. #endif /* SDL_internal_h_ */
  106. /* vi: set ts=4 sw=4 expandtab: */