Skip to content

use legacy atomics on gcc < 5 #893

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

Merged
merged 1 commit into from
Nov 12, 2021
Merged
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
6 changes: 3 additions & 3 deletions src/libbson/src/bson/bson-atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ enum bson_memory_order {
#define MSVC_MEMORDER_SUFFIX(X)
#endif

#if defined(USE_LEGACY_GCC_ATOMICS) || (!defined(__clang__) && \
__GNUC__ == 4 && __GNUC_MINOR__ >= 1 && __GNUC_MINOR__ < 9)
#if defined(USE_LEGACY_GCC_ATOMICS) || \
(!defined(__clang__) && __GNUC__ == 4)
#define BSON_USE_LEGACY_GCC_ATOMICS
#else
#undef BSON_USE_LEGACY_GCC_ATOMICS
#endif

/* Not all GCC-like compilers support the current __atomic built-ins. Older
* GCC (pre-4.9) used different built-ins named with the __sync prefix. When
* GCC (pre-5) used different built-ins named with the __sync prefix. When
* compiling with such older GCC versions, it is necessary to use the applicable
* functions, which requires redefining BSON_IF_GNU_LIKE and defining the
* additional BSON_IF_GNU_LEGACY_ATOMICS macro here. */
Expand Down