• Show log

    Commit

  • Hash : 66a08aa3
    Author : Misa
    Date : 2021-09-27T14:38:12

    Add and use `SDL_FALLTHROUGH` for fallthroughs Case fallthrough warnings can be suppressed using the __fallthrough__ compiler attribute. Unfortunately, not all compilers have this attribute, or even have __has_attribute to check if they have the __fallthrough__ attribute. [[fallthrough]] is also available in C++17 and the next C2x, but not everyone uses C++17 or C2x. So define the SDL_FALLTHROUGH macro to deal with those problems - if we are using C++17 or C2x, it expands to [[fallthrough]]; else if the compiler has __has_attribute and has the __fallthrough__ attribute, then it expands to __attribute__((__fallthrough__)); else it expands to an empty statement, with a /* fallthrough */ comment (it's a do {} while (0) statement, because users of this macro need to use a semicolon, because [[fallthrough]] and __attribute__((__fallthrough__)) require a semicolon). Applications using SDL are also free to use this macro (because it is defined in begin_code.h). All existing /* fallthrough */ comments have been replaced with this macro. Some of them were unnecessary because they were the last case in a switch; using SDL_FALLTHROUGH in those cases would result in a compile error on compilers that support __fallthrough__, for having a __attribute__((__fallthrough__)) statement that didn't immediately precede a case label.

  • Properties

  • Git HTTP https://git.kmx.io/kc3-lang/SDL.git
    Git SSH git@git.kmx.io:kc3-lang/SDL.git
    Public access ? public
    Description

    Fork of https://github.com/libsdl-org/SDL

    Users
    thodg_w thodg_m thodg_l kc3_lang_org thodg www_kmx_io
    Tags

  • README

  • These are test programs for the SDL library:
    
    	checkkeys	Watch the key events to check the keyboard
    	loopwave	Audio test -- loop playing a WAV file
    	loopwavequeue	Audio test -- loop playing a WAV file with SDL_QueueAudio
    	testsurround	Audio test -- play test tone on each audio channel
    	testaudioinfo	Lists audio device capabilities
    	testerror	Tests multi-threaded error handling
    	testfile	Tests RWops layer
    	testgl2		A very simple example of using OpenGL with SDL
    	testiconv	Tests international string conversion
    	testjoystick	List joysticks and watch joystick events
    	testkeys	List the available keyboard keys
    	testloadso	Tests the loadable library layer
    	testlocale  Test Locale API
    	testlock	Hacked up test of multi-threading and locking
    	testmouse	Tests mouse coordinates
    	testmultiaudio	Tests using several audio devices
    	testoverlay2	Tests the overlay flickering/scaling during playback.
    	testplatform	Tests types, endianness and cpu capabilities
    	testsem		Tests SDL's semaphore implementation
    	testshape	Tests shaped windows
    	testsprite2	Example of fast sprite movement on the screen
    	testthread	Hacked up test of multi-threading
    	testtimer	Test the timer facilities
    	testver		Check the version and dynamic loading and endianness
    	testwm2		Test window manager -- title, icon, events
    	torturethread	Simple test for thread creation/destruction
    	controllermap   Useful to generate Game Controller API compatible maps
    
    
    
    This directory contains sample.wav, which is a sample from Will Provost's
    song, The Living Proof:
    
         From the album The Living Proof
         Publisher: 5 Guys Named Will
         Copyright 1996 Will Provost
    
    You can get a copy of the full song (and album!) from iTunes...
    
        https://itunes.apple.com/us/album/the-living-proof/id4153978
    
    or Amazon...
    
        http://www.amazon.com/The-Living-Proof-Will-Provost/dp/B00004R8RH
    
    Thanks to Will for permitting us to distribute this sample with SDL!