Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only use noexcept in public headers on >= C++11 #1071

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion include/AL/al.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,19 @@
#ifdef __cplusplus
extern "C" {

#ifdef _MSVC_LANG
#define AL_CPLUSPLUS _MSVC_LANG
#else
#define AL_CPLUSPLUS __cplusplus
#endif

#ifndef AL_DISABLE_NOEXCEPT
#if AL_CPLUSPLUS >= 201103L
#define AL_API_NOEXCEPT noexcept
#if __cplusplus >= 201703L
#else
#define AL_API_NOEXCEPT
#endif
#if AL_CPLUSPLUS >= 201703L
#define AL_API_NOEXCEPT17 noexcept
#else
#define AL_API_NOEXCEPT17
Expand All @@ -19,6 +29,8 @@ extern "C" {
#define AL_API_NOEXCEPT17
#endif

#undef AL_CPLUSPLUS

#else /* __cplusplus */

#define AL_API_NOEXCEPT
Expand Down
14 changes: 13 additions & 1 deletion include/AL/alc.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,19 @@
#ifdef __cplusplus
extern "C" {

#ifdef _MSVC_LANG
#define ALC_CPLUSPLUS _MSVC_LANG
#else
#define ALC_CPLUSPLUS __cplusplus
#endif

#ifndef AL_DISABLE_NOEXCEPT
#if ALC_CPLUSPLUS >= 201103L
#define ALC_API_NOEXCEPT noexcept
#if __cplusplus >= 201703L
#else
#define ALC_API_NOEXCEPT
#endif
#if ALC_CPLUSPLUS >= 201703L
#define ALC_API_NOEXCEPT17 noexcept
#else
#define ALC_API_NOEXCEPT17
Expand All @@ -19,6 +29,8 @@ extern "C" {
#define ALC_API_NOEXCEPT17
#endif

#undef ALC_CPLUSPLUS

#else /* __cplusplus */

#define ALC_API_NOEXCEPT
Expand Down