Use #ifdef/#ifndef instead of #if defined/#if \!defined

This commit is contained in:
Anonymous Maarten
2023-03-30 20:26:31 +02:00
committed by Anonymous Maarten
parent 308bcbbe76
commit b6ae281e97
129 changed files with 450 additions and 450 deletions

View File

@@ -646,7 +646,7 @@ static int SDLCALL SDL_RunAudio(void *devicep)
SDL_assert(!device->iscapture);
#if defined(SDL_AUDIO_DRIVER_ANDROID)
#ifdef SDL_AUDIO_DRIVER_ANDROID
{
/* Set thread priority to THREAD_PRIORITY_AUDIO */
Android_JNI_AudioSetThreadPriority(device->iscapture, device->id);
@@ -746,7 +746,7 @@ static int SDLCALL SDL_CaptureAudio(void *devicep)
SDL_assert(device->iscapture);
#if defined(SDL_AUDIO_DRIVER_ANDROID)
#ifdef SDL_AUDIO_DRIVER_ANDROID
{
/* Set thread priority to THREAD_PRIORITY_AUDIO */
Android_JNI_AudioSetThreadPriority(device->iscapture, device->id);

View File

@@ -144,7 +144,7 @@ static int SDL_ConvertAudio(SDL_AudioCVT * cvt);
* 8 channels (7.1) layout: FL+FR+FC+LFE+BL+BR+SL+SR
*/
#if defined(SDL_SSE3_INTRINSICS)
#ifdef SDL_SSE3_INTRINSICS
/* Convert from stereo to mono. Average left and right. */
static void SDLCALL SDL_TARGETING("sse3") SDL_ConvertStereoToMono_SSE3(SDL_AudioCVT *cvt, SDL_AudioFormat format)
{
@@ -181,7 +181,7 @@ static void SDLCALL SDL_TARGETING("sse3") SDL_ConvertStereoToMono_SSE3(SDL_Audio
}
#endif
#if defined(SDL_SSE_INTRINSICS)
#ifdef SDL_SSE_INTRINSICS
/* Convert from mono to stereo. Duplicate to stereo left and right. */
static void SDLCALL SDL_TARGETING("sse") SDL_ConvertMonoToStereo_SSE(SDL_AudioCVT *cvt, SDL_AudioFormat format)
{
@@ -834,7 +834,7 @@ static int SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
/* swap in some SIMD versions for a few of these. */
if (channel_converter == SDL_ConvertStereoToMono) {
SDL_AudioFilter filter = NULL;
#if defined(SDL_SSE3_INTRINSICS)
#ifdef SDL_SSE3_INTRINSICS
if (!filter && SDL_HasSSE3()) {
filter = SDL_ConvertStereoToMono_SSE3;
}
@@ -844,7 +844,7 @@ static int SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
}
} else if (channel_converter == SDL_ConvertMonoToStereo) {
SDL_AudioFilter filter = NULL;
#if defined(SDL_SSE_INTRINSICS)
#ifdef SDL_SSE_INTRINSICS
if (!filter && SDL_HasSSE()) {
filter = SDL_ConvertMonoToStereo_SSE;
}

View File

@@ -226,7 +226,7 @@ static void SDLCALL SDL_Convert_F32_to_S32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFo
}
#endif
#if defined(SDL_SSE2_INTRINSICS)
#ifdef SDL_SSE2_INTRINSICS
static void SDLCALL SDL_TARGETING("sse2") SDL_Convert_S8_to_F32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format)
{
const Sint8 *src = ((const Sint8 *)(cvt->buf + cvt->len_cvt)) - 1;
@@ -1175,7 +1175,7 @@ void SDL_ChooseAudioConverters(void)
SDL_Convert_F32_to_S32 = SDL_Convert_F32_to_S32_##fntype; \
converters_chosen = SDL_TRUE
#if defined(SDL_SSE2_INTRINSICS)
#ifdef SDL_SSE2_INTRINSICS
if (SDL_HasSSE2()) {
SET_CONVERTER_FUNCS(SSE2);
return;

View File

@@ -25,7 +25,7 @@
#include "../SDL_sysaudio.h"
#if !defined(__IOS__)
#ifndef __IOS__
#define MACOSX_COREAUDIO
#endif

View File

@@ -891,7 +891,7 @@ static int prepare_audioqueue(_THIS)
/* Make sure we can feed the device a minimum amount of time */
MINIMUM_AUDIO_BUFFER_TIME_MS = 15.0;
#if defined(__IOS__)
#ifdef __IOS__
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_7_1) {
/* Older iOS hardware, use 40 ms as a minimum time */
MINIMUM_AUDIO_BUFFER_TIME_MS = 40.0;

View File

@@ -186,14 +186,14 @@ static BOOL CALLBACK FindAllDevs(LPGUID guid, LPCWSTR desc, LPCWSTR module, LPVO
static void DSOUND_DetectDevices(void)
{
#if defined(HAVE_MMDEVICEAPI_H)
#ifdef HAVE_MMDEVICEAPI_H
if (SupportsIMMDevice) {
SDL_IMMDevice_EnumerateEndpoints(SDL_TRUE);
} else {
#endif /* HAVE_MMDEVICEAPI_H */
pDirectSoundCaptureEnumerateW(FindAllDevs, (void *)((size_t)1));
pDirectSoundEnumerateW(FindAllDevs, (void *)((size_t)0));
#if defined(HAVE_MMDEVICEAPI_H)
#ifdef HAVE_MMDEVICEAPI_H
}
#endif /* HAVE_MMDEVICEAPI_H*/
}
@@ -609,7 +609,7 @@ static int DSOUND_OpenDevice(_THIS, const char *devname)
static void DSOUND_Deinitialize(void)
{
#if defined(HAVE_MMDEVICEAPI_H)
#ifdef HAVE_MMDEVICEAPI_H
if (SupportsIMMDevice) {
SDL_IMMDevice_Quit();
SupportsIMMDevice = SDL_FALSE;
@@ -624,7 +624,7 @@ static SDL_bool DSOUND_Init(SDL_AudioDriverImpl *impl)
return SDL_FALSE;
}
#if defined(HAVE_MMDEVICEAPI_H)
#ifdef HAVE_MMDEVICEAPI_H
SupportsIMMDevice = !(SDL_IMMDevice_Init() < 0);
#endif /* HAVE_MMDEVICEAPI_H */

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
#if defined(SDL_AUDIO_DRIVER_NETBSD)
#ifdef SDL_AUDIO_DRIVER_NETBSD
/*
* Driver for native NetBSD audio(4).