MongoDB C++ Driver legacy-1.1.1
Loading...
Searching...
No Matches
atomic_intrinsics.h
1/* Copyright 2012 10gen Inc.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
41#pragma once
42
43#include "mongo/config.h"
44
45#if defined(MONGO_HAVE_CXX11_ATOMICS)
46#error "Use of atomic_intrinsics.h is not supported when C++11 <atomic> is available"
47#endif
48
49#if defined(_WIN32)
50#include "mongo/platform/atomic_intrinsics_win32.h"
51#elif defined(MONGO_HAVE_GCC_ATOMIC_BUILTINS)
52#include "mongo/platform/atomic_intrinsics_gcc_atomic.h"
53#elif defined(MONGO_HAVE_GCC_SYNC_BUILTINS)
54#include "mongo/platform/atomic_intrinsics_gcc_sync.h"
55#elif defined(__i386__) || defined(__x86_64__)
56#include "mongo/platform/atomic_intrinsics_gcc_intel.h"
57#else
58#error "Unsupported os/compiler family"
59#endif