src/SDL_internal.h
author Ryan C. Gordon
Tue, 07 Apr 2020 14:03:13 -0400
changeset 13704 25edf3df6e51
parent 13696 ea20a7434b98
permissions -rw-r--r--
emscripten: support KaiOS's Left Soft Key and Right Soft Key (thanks, pelya!).

Fixes Bugzilla #5027.
icculus@8093
     1
/*
icculus@8093
     2
  Simple DirectMedia Layer
slouken@13422
     3
  Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
icculus@8093
     4
icculus@8093
     5
  This software is provided 'as-is', without any express or implied
icculus@8093
     6
  warranty.  In no event will the authors be held liable for any damages
icculus@8093
     7
  arising from the use of this software.
icculus@8093
     8
icculus@8093
     9
  Permission is granted to anyone to use this software for any purpose,
icculus@8093
    10
  including commercial applications, and to alter it and redistribute it
icculus@8093
    11
  freely, subject to the following restrictions:
icculus@8093
    12
icculus@8093
    13
  1. The origin of this software must not be misrepresented; you must not
icculus@8093
    14
     claim that you wrote the original software. If you use this software
icculus@8093
    15
     in a product, an acknowledgment in the product documentation would be
icculus@8093
    16
     appreciated but is not required.
icculus@8093
    17
  2. Altered source versions must be plainly marked as such, and must not be
icculus@8093
    18
     misrepresented as being the original software.
icculus@8093
    19
  3. This notice may not be removed or altered from any source distribution.
icculus@8093
    20
*/
slouken@10638
    21
#ifndef SDL_internal_h_
slouken@10638
    22
#define SDL_internal_h_
icculus@8093
    23
slouken@10607
    24
/* Many of SDL's features require _GNU_SOURCE on various platforms */
slouken@10604
    25
#ifndef _GNU_SOURCE
slouken@10604
    26
#define _GNU_SOURCE
slouken@10604
    27
#endif
slouken@10604
    28
icculus@10680
    29
/* This is for a variable-length array at the end of a struct:
icculus@10680
    30
    struct x { int y; char z[SDL_VARIABLE_LENGTH_ARRAY]; };
icculus@10680
    31
   Use this because GCC 2 needs different magic than other compilers. */
icculus@11726
    32
#if (defined(__GNUC__) && (__GNUC__ <= 2)) || defined(__CC_ARM) || defined(__cplusplus)
icculus@10680
    33
#define SDL_VARIABLE_LENGTH_ARRAY 1
icculus@10680
    34
#else
icculus@10680
    35
#define SDL_VARIABLE_LENGTH_ARRAY
icculus@10680
    36
#endif
icculus@10680
    37
icculus@12349
    38
#define SDL_MAX_SMALL_ALLOC_STACKSIZE 128
icculus@12349
    39
#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))) )
icculus@12349
    40
#define SDL_small_free(ptr, isstack) if ((isstack)) { SDL_stack_free(ptr); } else { SDL_free(ptr); }
icculus@12349
    41
icculus@8094
    42
#include "dynapi/SDL_dynapi.h"
icculus@8094
    43
icculus@8094
    44
#if SDL_DYNAMIC_API
icculus@8094
    45
#include "dynapi/SDL_dynapi_overrides.h"
icculus@8094
    46
/* force DECLSPEC and SDLCALL off...it's all internal symbols now.
icculus@8094
    47
   These will have actual #defines during SDL_dynapi.c only */
icculus@8094
    48
#define DECLSPEC
icculus@8094
    49
#define SDLCALL
icculus@8094
    50
#endif
icculus@8094
    51
icculus@8093
    52
#include "SDL_config.h"
icculus@8093
    53
sylvain@13433
    54
/* A few #defines to reduce SDL2 footprint.
sylvain@13437
    55
   Only effective when library is statically linked.
sylvain@13437
    56
   You have to manually edit this file. */
slouken@13440
    57
#ifndef SDL_LEAN_AND_MEAN
slouken@13441
    58
#define SDL_LEAN_AND_MEAN               0
slouken@13440
    59
#endif
sylvain@13437
    60
sylvain@13437
    61
/* Optimized functions from 'SDL_blit_0.c'
sylvain@13437
    62
   - blit with source BitsPerPixel < 8, palette */
slouken@13440
    63
#ifndef SDL_HAVE_BLIT_0
slouken@13440
    64
#define SDL_HAVE_BLIT_0                 !SDL_LEAN_AND_MEAN
slouken@13440
    65
#endif
sylvain@13437
    66
sylvain@13437
    67
/* Optimized functions from 'SDL_blit_1.c'
sylvain@13437
    68
   - blit with source BytesPerPixel == 1, palette */
slouken@13440
    69
#ifndef SDL_HAVE_BLIT_1
slouken@13440
    70
#define SDL_HAVE_BLIT_1                 !SDL_LEAN_AND_MEAN
slouken@13440
    71
#endif
sylvain@13437
    72
sylvain@13437
    73
/* Optimized functions from 'SDL_blit_A.c'
sylvain@13437
    74
   - blit with 'SDL_BLENDMODE_BLEND' blending mode */
slouken@13440
    75
#ifndef SDL_HAVE_BLIT_A
slouken@13440
    76
#define SDL_HAVE_BLIT_A                 !SDL_LEAN_AND_MEAN
slouken@13440
    77
#endif
sylvain@13437
    78
sylvain@13437
    79
/* Optimized functions from 'SDL_blit_N.c'
sylvain@13437
    80
   - blit with COLORKEY mode, or nothing */
slouken@13440
    81
#ifndef SDL_HAVE_BLIT_N
slouken@13440
    82
#define SDL_HAVE_BLIT_N                 !SDL_LEAN_AND_MEAN
slouken@13440
    83
#endif
sylvain@13437
    84
sylvain@13437
    85
/* Optimized functions from 'SDL_blit_N.c'
sylvain@13437
    86
   - RGB565 conversion with Lookup tables */
slouken@13440
    87
#ifndef SDL_HAVE_BLIT_N_RGB565
slouken@13440
    88
#define SDL_HAVE_BLIT_N_RGB565          !SDL_LEAN_AND_MEAN
slouken@13440
    89
#endif
sylvain@13437
    90
sylvain@13437
    91
/* Optimized functions from 'SDL_blit_AUTO.c'
sylvain@13437
    92
   - blit with modulate color, modulate alpha, any blending mode
sylvain@13437
    93
   - scaling or not */
slouken@13440
    94
#ifndef SDL_HAVE_BLIT_AUTO
slouken@13440
    95
#define SDL_HAVE_BLIT_AUTO              !SDL_LEAN_AND_MEAN
slouken@13440
    96
#endif
sylvain@13437
    97
sylvain@13437
    98
/* Run-Length-Encoding
sylvain@13437
    99
   - SDL_SetColorKey() called with SDL_RLEACCEL flag */
slouken@13440
   100
#ifndef SDL_HAVE_RLE
slouken@13440
   101
#define SDL_HAVE_RLE                    !SDL_LEAN_AND_MEAN
slouken@13440
   102
#endif
sylvain@13437
   103
sylvain@13437
   104
/* Software SDL_Renderer
sylvain@13437
   105
   - creation of software renderer
sylvain@13437
   106
   - *not* general blitting functions
sylvain@13437
   107
   - {blend,draw}{fillrect,line,point} internal functions */
slouken@13440
   108
#ifndef SDL_VIDEO_RENDER_SW
slouken@13440
   109
#define SDL_VIDEO_RENDER_SW             !SDL_LEAN_AND_MEAN
slouken@13440
   110
#endif
sylvain@13437
   111
sylvain@13437
   112
/* YUV formats
sylvain@13437
   113
   - handling of YUV surfaces
sylvain@13437
   114
   - blitting and conversion functions */
slouken@13440
   115
#ifndef SDL_HAVE_YUV
slouken@13440
   116
#define SDL_HAVE_YUV                    !SDL_LEAN_AND_MEAN
slouken@13440
   117
#endif
sylvain@13433
   118
slouken@13696
   119
#include "SDL_log.h"
slouken@13696
   120
slouken@10638
   121
#endif /* SDL_internal_h_ */
icculus@8093
   122
icculus@8093
   123
/* vi: set ts=4 sw=4 expandtab: */