GME  13
apr_arch_atomic.h
Go to the documentation of this file.
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef ATOMIC_H
00018 #define ATOMIC_H
00019 
00020 #include "apr.h"
00021 #include "apr_private.h"
00022 #include "apr_atomic.h"
00023 #include "apr_thread_mutex.h"
00024 
00025 #if defined(USE_ATOMICS_GENERIC)
00026 /* noop */
00027 #elif defined(__GNUC__) && defined(__STRICT_ANSI__)
00028 /* force use of generic atomics if building e.g. with -std=c89, which
00029  * doesn't allow inline asm */
00030 #   define USE_ATOMICS_GENERIC
00031 #elif HAVE_ATOMIC_BUILTINS
00032 #   define USE_ATOMICS_BUILTINS
00033 #elif defined(SOLARIS2) && SOLARIS2 >= 10
00034 #   define USE_ATOMICS_SOLARIS
00035 #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
00036 #   define USE_ATOMICS_IA32
00037 #elif defined(__GNUC__) && (defined(__PPC__) || defined(__ppc__))
00038 #   define USE_ATOMICS_PPC
00039 #elif defined(__GNUC__) && (defined(__s390__) || defined(__s390x__))
00040 #   define USE_ATOMICS_S390
00041 #else
00042 #   define USE_ATOMICS_GENERIC
00043 #endif
00044 
00045 #endif /* ATOMIC_H */