-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiagnostics.hpp
More file actions
42 lines (27 loc) · 1.3 KB
/
diagnostics.hpp
File metadata and controls
42 lines (27 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) 2024-2026 Jakub Musiał
// This file is part of the CPP-GL project (https://github.com/SpectraL519/cpp-gl).
// Licensed under the MIT License. See the LICENSE file in the project root for full license information.
#pragma once
#define GL_PRAGMA(x) _Pragma(#x)
#if defined(__clang__)
#define GL_SUPPRESS_WARNING_BEGIN(w) \
GL_PRAGMA(clang diagnostic push) \
GL_PRAGMA(clang diagnostic ignored w)
#define GL_SUPPRESS_WARNING_END GL_PRAGMA(clang diagnostic pop)
#define GL_SUPPRESS_CLANG_WARNING_BEGIN(w) GL_SUPPRESS_WARNING_BEGIN(w)
// GCC-only warning: Push on Clang to keep the END macro balanced, but don't ignore
#define GL_SUPPRESS_GCC_WARNING_BEGIN(w) GL_PRAGMA(clang diagnostic push)
#elif defined(__GNUC__)
#define GL_SUPPRESS_WARNING_BEGIN(w) \
GL_PRAGMA(GCC diagnostic push) \
GL_PRAGMA(GCC diagnostic ignored w)
#define GL_SUPPRESS_WARNING_END GL_PRAGMA(GCC diagnostic pop)
#define GL_SUPPRESS_GCC_WARNING_BEGIN(w) GL_SUPPRESS_WARNING_BEGIN(w)
// Clang-only warning: Push on GCC to keep the END macro balanced, but don't ignore
#define GL_SUPPRESS_CLANG_WARNING_BEGIN(w) GL_PRAGMA(GCC diagnostic push)
#else
#define GL_SUPPRESS_WARNING_BEGIN(w)
#define GL_SUPPRESS_WARNING_END
#define GL_SUPPRESS_GCC_WARNING_BEGIN(w)
#define GL_SUPPRESS_CLANG_WARNING_BEGIN(w)
#endif