We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3535 - Misplaced comment #if/#endif closure comment
Summary: Misplaced comment #if/#endif closure comment
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: audio (show other bugs)
Version: 2.0.5
Hardware: All Windows (All)
: P2 trivial
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-30 01:04 UTC by Coriiander
Modified: 2017-01-01 00:22 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Coriiander 2016-12-30 01:04:11 UTC
This notice is about the following file:
"src/audio/xaudio2/SDL_xaudio2.c"

This notice is about a misplaced comment.

Often times when we use an #if #endif sequence, the #endif is followed by a comment to indicate what #if statement it belonged to. The SDL_xaudio2.c file contains a misplaced comment, as follows (I stripped the other comments):

#ifdef __GNUC__
#  define SDL_XAUDIO2_HAS_SDK 1
#elif defined(__WINRT__)
#  define SDL_XAUDIO2_HAS_SDK
#include "SDL_xaudio2.h"
#else
#if 0
#include <dxsdkver.h>
#if (!defined(_DXSDK_BUILD_MAJOR) || (_DXSDK_BUILD_MAJOR < 1284))
#  pragma message("Your DirectX SDK is too old. Disabling XAudio2 support.")
#else
#  define SDL_XAUDIO2_HAS_SDK 1
#endif
#endif
#endif /* 0 */



That final /* 0 */ should be moved one line up. Like this (I tabbed it out for you to make it more clear):




#ifdef __GNUC__
    #define SDL_XAUDIO2_HAS_SDK 1
#elif defined(__WINRT__)
    #define SDL_XAUDIO2_HAS_SDK
    #include "SDL_xaudio2.h"
#else
    #if 0
        #include <dxsdkver.h>
        #if (!defined(_DXSDK_BUILD_MAJOR) || (_DXSDK_BUILD_MAJOR < 1284))
            #pragma message("Your DirectX SDK is too old. Disabling XAudio2 support.")
        #else
            #define SDL_XAUDIO2_HAS_SDK 1
        #endif
    #endif /* 0, comment moved up from the line below this line */
#endif /* moved the 0 one line up */
Comment 1 Sam Lantinga 2017-01-01 00:22:06 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/a4bf6eab5aef