Skip to content

Commit 5202ba1

Browse files
ala-abletoncdi-ableton
authored andcommitted
Do not disable C4668 globally
1 parent 7d9c1ce commit 5202ba1

File tree

9 files changed

+30
-24
lines changed

9 files changed

+30
-24
lines changed

cmake_include/ConfigureCompileFlags.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
100100
"/wd4626" # 'Derived class' : assignment operator was implicitly defined as deleted because a base class assignment operator is inaccessible or deleted
101101
"/wd4628" # digraphs not supported with -Ze. Character sequence 'digraph' not interpreted as alternate token for 'char'
102102
"/wd4640" # 'Instance': construction of local static object is not thread-safe
103-
"/wd4668" # 'Symbol' is not defined as a preprocessor macro, replacing with '0' for 'directives'
104103
"/wd4710" # 'Function': function not inlined
105104
"/wd4711" # Function 'function' selected for inline expansion
106105
"/wd4738" # Storing 32-bit float result in memory, possible loss of performance

examples/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ if(WIN32)
143143
# When building LinkHut, additional warnings are generated from third-party frameworks
144144
set(extra_ignored_warnings_LIST
145145
"/wd4127" # conditional expression is constant
146+
"/wd4668" # 'symbol' is not defined as a preprocessor macro, replacing with '0' for 'directives'
146147
"/wd4702" # unreachable code
147148
)
148149
if(LINK_BUILD_ASIO)

examples/linkaudio/AudioPlatform.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,26 @@
1919

2020
#pragma once
2121

22-
#if LINKHUT_AUDIO_PLATFORM_ASIO
22+
#if defined(LINKHUT_AUDIO_PLATFORM_ASIO)
2323
#include "AudioPlatform_Asio.hpp"
2424
#endif
2525

26-
#if LINKHUT_AUDIO_PLATFORM_COREAUDIO
26+
#if defined(LINKHUT_AUDIO_PLATFORM_COREAUDIO)
2727
#include "AudioPlatform_CoreAudio.hpp"
2828
#endif
2929

30-
#if LINKHUT_AUDIO_PLATFORM_DUMMY
30+
#if defined(LINKHUT_AUDIO_PLATFORM_DUMMY)
3131
#include "AudioPlatform_Dummy.hpp"
3232
#endif
3333

34-
#if LINKHUT_AUDIO_PLATFORM_JACK
34+
#if defined(LINKHUT_AUDIO_PLATFORM_JACK)
3535
#include "AudioPlatform_Jack.hpp"
3636
#endif
3737

38-
#if LINKHUT_AUDIO_PLATFORM_PORTAUDIO
38+
#if defined(LINKHUT_AUDIO_PLATFORM_PORTAUDIO)
3939
#include "AudioPlatform_Portaudio.hpp"
4040
#endif
4141

42-
#if LINKHUT_AUDIO_PLATFORM_WASAPI
42+
#if defined(LINKHUT_AUDIO_PLATFORM_WASAPI)
4343
#include "AudioPlatform_Wasapi.hpp"
4444
#endif

examples/linkhut/main.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <chrono>
2525
#include <iostream>
2626
#include <thread>
27-
#if LINK_PLATFORM_UNIX
27+
#if defined(LINK_PLATFORM_UNIX)
2828
#include <termios.h>
2929
#endif
3030

@@ -45,7 +45,7 @@ struct State
4545

4646
void disableBufferedInput()
4747
{
48-
#if LINK_PLATFORM_UNIX
48+
#if defined(LINK_PLATFORM_UNIX)
4949
termios t;
5050
tcgetattr(STDIN_FILENO, &t);
5151
t.c_lflag &= ~ICANON;
@@ -55,7 +55,7 @@ void disableBufferedInput()
5555

5656
void enableBufferedInput()
5757
{
58-
#if LINK_PLATFORM_UNIX
58+
#if defined(LINK_PLATFORM_UNIX)
5959
termios t;
6060
tcgetattr(STDIN_FILENO, &t);
6161
t.c_lflag |= ICANON;
@@ -108,7 +108,7 @@ void input(State& state)
108108
{
109109
char in;
110110

111-
#if LINK_PLATFORM_WINDOWS
111+
#if defined(LINK_PLATFORM_WINDOWS)
112112
HANDLE stdinHandle = GetStdHandle(STD_INPUT_HANDLE);
113113
DWORD numCharsRead;
114114
INPUT_RECORD inputRecord;
@@ -117,7 +117,7 @@ void input(State& state)
117117
ReadConsoleInput(stdinHandle, &inputRecord, 1, &numCharsRead);
118118
} while ((inputRecord.EventType != KEY_EVENT) || inputRecord.Event.KeyEvent.bKeyDown);
119119
in = inputRecord.Event.KeyEvent.uChar.AsciiChar;
120-
#elif LINK_PLATFORM_UNIX
120+
#elif defined(LINK_PLATFORM_UNIX)
121121
in = std::cin.get();
122122
#endif
123123

include/ableton/discovery/NetworkByteStreamSerializable.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
#pragma once
2121

2222
#include <ableton/platforms/asio/AsioWrapper.hpp>
23-
#if LINK_PLATFORM_MACOSX
23+
#if defined(LINK_PLATFORM_MACOSX)
2424
#include <ableton/platforms/darwin/Darwin.hpp>
25-
#elif LINK_PLATFORM_LINUX
25+
#elif defined(LINK_PLATFORM_LINUX)
2626
#include <ableton/platforms/linux/Linux.hpp>
2727
#endif
2828

@@ -32,7 +32,7 @@
3232
#include <utility>
3333
#include <vector>
3434

35-
#if LINK_PLATFORM_WINDOWS
35+
#if defined(LINK_PLATFORM_WINDOWS)
3636
#include <WS2tcpip.h>
3737
#include <WinSock2.h>
3838
#include <Windows.h>

include/ableton/platforms/Config.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
#include <ableton/link/Controller.hpp>
2323
#include <ableton/util/Log.hpp>
2424

25-
#if LINK_PLATFORM_WINDOWS
25+
#if defined(LINK_PLATFORM_WINDOWS)
2626
#include <ableton/platforms/asio/Context.hpp>
2727
#include <ableton/platforms/windows/Clock.hpp>
2828
#include <ableton/platforms/windows/ScanIpIfAddrs.hpp>
29-
#elif LINK_PLATFORM_MACOSX
29+
#elif defined(LINK_PLATFORM_MACOSX)
3030
#include <ableton/platforms/asio/Context.hpp>
3131
#include <ableton/platforms/darwin/Clock.hpp>
3232
#include <ableton/platforms/posix/ScanIpIfAddrs.hpp>
33-
#elif LINK_PLATFORM_LINUX
33+
#elif defined(LINK_PLATFORM_LINUX)
3434
#include <ableton/platforms/asio/Context.hpp>
3535
#include <ableton/platforms/linux/Clock.hpp>
3636
#include <ableton/platforms/posix/ScanIpIfAddrs.hpp>
@@ -43,17 +43,17 @@ namespace link
4343
namespace platform
4444
{
4545

46-
#if LINK_PLATFORM_WINDOWS
46+
#if defined(LINK_PLATFORM_WINDOWS)
4747
using Clock = platforms::windows::Clock;
4848
using IoContext =
4949
platforms::asio::Context<platforms::windows::ScanIpIfAddrs, util::NullLog>;
5050

51-
#elif LINK_PLATFORM_MACOSX
51+
#elif defined(LINK_PLATFORM_MACOSX)
5252
using Clock = platforms::darwin::Clock;
5353
using IoContext =
5454
platforms::asio::Context<platforms::posix::ScanIpIfAddrs, util::NullLog>;
5555

56-
#elif LINK_PLATFORM_LINUX
56+
#elif defined(LINK_PLATFORM_LINUX)
5757
using Clock = platforms::linux::ClockMonotonic;
5858
using IoContext =
5959
platforms::asio::Context<platforms::posix::ScanIpIfAddrs, util::NullLog>;

include/ableton/platforms/asio/AsioWrapper.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#pragma push_macro("ASIO_NO_TYPEID")
3333
#define ASIO_NO_TYPEID 1
3434

35-
#if LINK_PLATFORM_WINDOWS
35+
#if defined(LINK_PLATFORM_WINDOWS)
3636
#pragma push_macro("INCL_EXTRA_HTON_FUNCTIONS")
3737
#define INCL_EXTRA_HTON_FUNCTIONS 1
3838
#endif
@@ -53,14 +53,17 @@
5353
#pragma warning(disable : 4548)
5454
// C4619: #pragma warning : there is no warning number 'number'
5555
#pragma warning(disable : 4619)
56+
// C4668: 'symbol' is not defined as a preprocessor macro, replacing with '0' for
57+
// 'directives'
58+
#pragma warning(disable : 4668)
5659
// C4675: 'function' : resolved overload was found by argument-dependent lookup
5760
#pragma warning(disable : 4675)
5861
#endif
5962

6063
#include <asio.hpp>
6164
#include <asio/system_timer.hpp>
6265

63-
#if LINK_PLATFORM_WINDOWS
66+
#if defined(LINK_PLATFORM_WINDOWS)
6467
#pragma pop_macro("INCL_EXTRA_HTON_FUNCTIONS")
6568
#endif
6669

include/ableton/test/CatchWrapper.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
#pragma warning(push)
3232
// C4388: signed/unsigned mismatch
3333
#pragma warning(disable : 4388)
34+
// C4668: 'symbol' is not defined as a preprocessor macro, replacing with '0' for
35+
// 'directives'
36+
#pragma warning(disable : 4668)
3437
// C4702: unreachable code
3538
#pragma warning(disable : 4702)
3639
#endif

src/ableton/test/catch/CatchMain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <ableton/test/CatchWrapper.hpp>
2323
#include <string>
2424

25-
#if LINK_PLATFORM_WINDOWS && LINK_BUILD_VLD
25+
#if defined(LINK_PLATFORM_WINDOWS) && LINK_BUILD_VLD
2626
#include <vld.h>
2727
#endif
2828

0 commit comments

Comments
 (0)