ianh 02/02/17 11:54:03
Modified: include apr_atomic.h
atomic/unix apr_atomic.c
Log:
preperation for solaris sparc addition
just need to figure out
a) where to put it
b) how to build it in a apr-nice way
Revision Changes Path
1.5 +13 -1 apr/include/apr_atomic.h
Index: apr_atomic.h
===================================================================
RCS file: /home/cvs/apr/include/apr_atomic.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- apr_atomic.h 16 Feb 2002 18:34:54 -0000 1.4
+++ apr_atomic.h 17 Feb 2002 19:54:03 -0000 1.5
@@ -87,8 +87,19 @@
#define apr_atomic_read(mem) atomic_read(mem)
#define apr_atomic_init(pool) APR_SUCCESS
-#else /* !defined(WIN32) && !defined(__linux) */
+#elif defined(__sparc__not_ready_yet)
+#define apr_atomic_t apr_uint32_t
+#define apr_atomic_read(p) *p
+
+#define apr_atomic_add(mem, val) apr_atomic_add_sparc(mem,val)
+#define apr_atomic_dec(mem) apr_atomic_sub_sparc(mem,1)
+#define apr_atomic_inc(mem) apr_atomic_add_sparc(mem,1)
+#define apr_atomic_set(mem, val) *mem= val
+#define apr_atomic_init(pool) APR_SUCCESS
+apr_uint32_t apr_atomic_add_sparc( volatile apr_atomic_t* mem, apr_uint32_t
add);
+apr_uint32_t apr_atomic_sub_sparc( volatile apr_atomic_t* mem, apr_uint32_t
sub);
+#else
#if APR_HAS_THREADS
#define apr_atomic_t apr_uint32_t
@@ -100,6 +111,7 @@
apr_uint32_t apr_atomic_dec(volatile apr_atomic_t *mem);
/*long apr_atomic_cas(volatile apr_atomic_t *mem,long with,long cmp);*/
+#define APR_ATOMIC_NEED_DEFAULT 1
#endif /* APR_HAS_THREADS */
#endif /* !defined(WIN32) && !defined(__linux) */
1.4 +2 -6 apr/atomic/unix/apr_atomic.c
Index: apr_atomic.c
===================================================================
RCS file: /home/cvs/apr/atomic/unix/apr_atomic.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- apr_atomic.c 16 Feb 2002 16:34:32 -0000 1.3
+++ apr_atomic.c 17 Feb 2002 19:54:03 -0000 1.4
@@ -3,11 +3,7 @@
#include "apr_thread_mutex.h"
#include "apr_atomic.h"
-#ifdef WIN32
-/* win32 implementation is all macros */
-#elif defined(__linux)
-/* linux implementation is all macros */
-#else
+#if defined(APR_ATOMIC_NEED_DEFAULT)
#if APR_HAS_THREADS
@@ -104,4 +100,4 @@
#endif
#endif /* APR_HAS_THREADS */
-#endif /* default implementation */
+#endif /* APR_ATOMIC_NEED_DEFAULT */