1251875Speter/* Licensed to the Apache Software Foundation (ASF) under one or more 2251875Speter * contributor license agreements. See the NOTICE file distributed with 3251875Speter * this work for additional information regarding copyright ownership. 4251875Speter * The ASF licenses this file to You under the Apache License, Version 2.0 5251875Speter * (the "License"); you may not use this file except in compliance with 6251875Speter * the License. You may obtain a copy of the License at 7251875Speter * 8251875Speter * http://www.apache.org/licenses/LICENSE-2.0 9251875Speter * 10251875Speter * Unless required by applicable law or agreed to in writing, software 11251875Speter * distributed under the License is distributed on an "AS IS" BASIS, 12251875Speter * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13251875Speter * See the License for the specific language governing permissions and 14251875Speter * limitations under the License. 15251875Speter */ 16251875Speter 17251875Speter#ifndef ATOMIC_H 18251875Speter#define ATOMIC_H 19251875Speter 20251875Speter#include "apr.h" 21251875Speter#include "apr_private.h" 22251875Speter#include "apr_atomic.h" 23251875Speter#include "apr_thread_mutex.h" 24251875Speter 25251875Speter#if defined(USE_ATOMICS_GENERIC) 26251875Speter/* noop */ 27251875Speter#elif defined(__GNUC__) && defined(__STRICT_ANSI__) 28251875Speter/* force use of generic atomics if building e.g. with -std=c89, which 29251875Speter * doesn't allow inline asm */ 30251875Speter# define USE_ATOMICS_GENERIC 31251875Speter#elif HAVE_ATOMIC_BUILTINS 32251875Speter# define USE_ATOMICS_BUILTINS 33251875Speter#elif defined(SOLARIS2) && SOLARIS2 >= 10 34251875Speter# define USE_ATOMICS_SOLARIS 35251875Speter#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) 36251875Speter# define USE_ATOMICS_IA32 37251875Speter#elif defined(__GNUC__) && (defined(__PPC__) || defined(__ppc__)) 38251875Speter# define USE_ATOMICS_PPC 39251875Speter#elif defined(__GNUC__) && (defined(__s390__) || defined(__s390x__)) 40251875Speter# define USE_ATOMICS_S390 41251875Speter#else 42251875Speter# define USE_ATOMICS_GENERIC 43251875Speter#endif 44251875Speter 45251875Speter#endif /* ATOMIC_H */ 46