INSTALL.txt
author Sam Lantinga <slouken@libsdl.org>
Mon, 12 Nov 2018 19:23:49 -0800
changeset 12408 b590d04d5cf7
parent 10893 54480745c410
permissions -rw-r--r--
Fixed bug 4377 - SDL_PIXELFORMAT enum is anonymous, which prevents its use in a templated function

zen3d

While trying to build Pixie lisp (https://github.com/pixie-lang/pixie), which uses SDL for multimedia output, the mandelbrot example won't build. The problem is that internally pixie uses a templated function to dump a value, and gcc chokes because SDL_PIXELFORMAT_RGA8888 is an anonymous enum.

I solved the problem locally by changing from:
enum {
SDL_PIXELFORMAT_UNKNOWN,
... etc. ...
SDL_PIXELFORMAT_YUYV = ... etc ...
};
to:
typedef enum {
SDL_PIXELFORMAT_UNKNOWN,
... etc. ...
SDL_PIXELFORMAT_YUYV = ... etc ...
} SDL_PIXELFORMAT_ENUM;
The net result of this change is that the enum containing SDL_PIXELFORMAT_* is no longer an anonymous enum and can now be used by a templated function.

This local change fixes Pixie lisp for me.

I did notice that you use the idiom
typedef enum {
... etc ...
} SDL_FOO;
elsewhere in your code, so that change to SDL_PIXELFORMAT doesn't look like it would have a negative impact.
     1 
     2 To compile and install SDL:
     3 
     4     1.  Windows with Visual Studio:
     5         * Read VisualC.html
     6 
     7         Windows with gcc, either native or cross-compiling:
     8         * Read the FAQ at https://wiki.libsdl.org/moin.fcg/FAQWindows
     9         * Run './configure; make; make install'
    10 
    11         Mac OS X with Xcode:
    12         * Read docs/README-macosx.md
    13 
    14         Mac OS X from the command line:
    15         * Run './configure; make; make install'
    16 
    17         Linux and other UNIX systems:
    18         * Run './configure; make; make install'
    19 
    20         Android:
    21         * Read docs/README-android.md
    22 
    23         iOS:
    24         * Read docs/README-ios.md
    25 
    26         Using Cmake:
    27         * Read docs/README-cmake.md
    28 
    29     2.  Look at the example programs in ./test, and check out the online
    30         documentation at https://wiki.libsdl.org/
    31 
    32     3.  Join the SDL developer mailing list by sending E-mail to
    33     	sdl-request@libsdl.org
    34         and put "subscribe" in the subject of the message.
    35 
    36         Or alternatively you can use the web interface:
    37             https://www.libsdl.org/mailing-list.php
    38 
    39 That's it!
    40 Sam Lantinga <slouken@libsdl.org>