Updated Branches: refs/heads/master 0b39cd771 -> 1b66ce806
TS-1124 Try to fix regex_remap to build on Solaris, try 4 Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/1b66ce80 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/1b66ce80 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/1b66ce80 Branch: refs/heads/master Commit: 1b66ce806c0adc9076ff744bec10e613badc0916 Parents: 0b39cd7 Author: Leif Hedstrom <[email protected]> Authored: Thu Mar 8 11:45:46 2012 -0700 Committer: Leif Hedstrom <[email protected]> Committed: Thu Mar 8 11:45:46 2012 -0700 ---------------------------------------------------------------------- plugins/header_filter/lulu.h | 33 ++------------------------------- 1 files changed, 2 insertions(+), 31 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b66ce80/plugins/header_filter/lulu.h ---------------------------------------------------------------------- diff --git a/plugins/header_filter/lulu.h b/plugins/header_filter/lulu.h index 040c7c9..0271738 100644 --- a/plugins/header_filter/lulu.h +++ b/plugins/header_filter/lulu.h @@ -24,6 +24,8 @@ #ifndef __LULU_H__ #define __LULU_H__ 1 +#include "ink_atomic.h" + // Define UNUSED properly. #if ((__GNUC__ >= 3) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7))) #define UNUSED __attribute__ ((unused)) @@ -50,37 +52,6 @@ static const char* PLUGIN_NAME = "header_filter"; static const char* PLUGIN_NAME_DBG = "header_filter_dbg"; - -// From the atomic portions of ATS -typedef int int32; -typedef unsigned int intu32; -typedef long long int64; -typedef unsigned long long intu64; - -typedef volatile int32 vint32; -typedef volatile int64 vint64; -typedef volatile void *vvoidp; -typedef vint32 *pvint32; -typedef vint64 *pvint64; -typedef vvoidp *pvvoidp; - -#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 1) - -/* see http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html */ -static inline int32 ink_atomic_swap(pvint32 mem, int32 value) { return __sync_lock_test_and_set(mem, value); } -static inline int64 ink_atomic_swap64(pvint64 mem, int64 value) { return __sync_lock_test_and_set(mem, value); } -static inline void *ink_atomic_swap_ptr(vvoidp mem, void *value) { return __sync_lock_test_and_set((void**)mem, value); } -static inline int ink_atomic_cas(pvint32 mem, int old, int new_value) { return __sync_bool_compare_and_swap(mem, old, new_value); } -static inline int64 ink_atomic_cas64(pvint64 mem, int64 old, int64 new_value) { return __sync_bool_compare_and_swap(mem, old, new_value); } -static inline int ink_atomic_cas_ptr(pvvoidp mem, void* old, void* new_value) { return __sync_bool_compare_and_swap(mem, old, new_value); } -static inline int ink_atomic_increment(pvint32 mem, int value) { return __sync_fetch_and_add(mem, value); } -static inline int64 ink_atomic_increment64(pvint64 mem, int64 value) { return __sync_fetch_and_add(mem, value); } -#else -// TODO: Deal with this case? -#failure -#endif - - // From google styleguide: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&); \
