Closing in on compilation with Solaris (and other non-GNU) compilers.
This commit was SVN r2244.
Этот коммит содержится в:
родитель
eca03817dc
Коммит
b1ff3e50c2
@ -413,7 +413,7 @@ static inline int ompi_obj_update(ompi_object_t *object, int inc)
|
||||
addr = (LONG volatile *) &(object->obj_reference_count);
|
||||
newval = (int) InterlockedExchangeAdd(addr, (LONG) inc) + inc;
|
||||
|
||||
#elif OMPI_SYS_ARCH_ATOMIC_H
|
||||
#elif OMPI_HAVE_ATOMIC
|
||||
|
||||
int newval;
|
||||
int oldval;
|
||||
|
@ -305,32 +305,51 @@ static inline void ompi_atomic_lock(ompi_lock_t *lock);
|
||||
static inline void ompi_atomic_unlock(ompi_lock_t *lock);
|
||||
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
/*
|
||||
* Include system specific inline asm definitions. Otherwise
|
||||
* the definitions are in system specific .s files in src/util.
|
||||
*/
|
||||
|
||||
#if defined(__alpha__)
|
||||
# include "alpha/atomic.h"
|
||||
# define OMPI_HAVE_ATOMIC 1
|
||||
# ifdef __GNUC__
|
||||
# include "alpha/atomic.h"
|
||||
# endif
|
||||
#elif defined(__amd64__)
|
||||
# include "amd64/atomic.h"
|
||||
# define OMPI_HAVE_ATOMIC 1
|
||||
# ifdef __GNUC__
|
||||
# include "amd64/atomic.h"
|
||||
# endif
|
||||
#elif defined(__i386__)
|
||||
# include "ia32/atomic.h"
|
||||
# define OMPI_HAVE_ATOMIC 1
|
||||
# ifdef __GNUC__
|
||||
# include "ia32/atomic.h"
|
||||
# endif
|
||||
#elif defined(__ia64__)
|
||||
# include "ia64/atomic.h"
|
||||
# define OMPI_HAVE_ATOMIC 1
|
||||
# ifdef __GNUC__
|
||||
# include "ia64/atomic.h"
|
||||
# endif
|
||||
#elif defined(__POWERPC__)
|
||||
# include "powerpc/atomic.h"
|
||||
# define OMPI_HAVE_ATOMIC 1
|
||||
# ifdef __GNUC__
|
||||
# include "powerpc/atomic.h"
|
||||
# endif
|
||||
#elif defined(__sparc__) || defined(__sparc)
|
||||
# include "sparc64/atomic.h"
|
||||
# define OMPI_HAVE_ATOMIC 1
|
||||
# ifdef __GNUC__
|
||||
# include "sparc64/atomic.h"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef OMPI_HAVE_ATOMIC
|
||||
#define OMPI_HAVE_ATOMIC 0
|
||||
#endif
|
||||
|
||||
#if OMPI_HAVE_ATOMIC
|
||||
|
||||
/*
|
||||
* implementation (derived)
|
||||
* derived operations
|
||||
*/
|
||||
|
||||
#if SIZEOF_INT == 4
|
||||
@ -547,4 +566,6 @@ static inline void ompi_atomic_unlock(ompi_lock_t *lock)
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* OMPI_HAVE_ATOMIC */
|
||||
|
||||
#endif /* OMPI_SYS_ATOMIC_H */
|
||||
|
@ -34,7 +34,7 @@ static void ompi_mutex_construct(ompi_mutex_t *m)
|
||||
#if OMPI_HAVE_POSIX_THREADS
|
||||
pthread_mutex_init(&m->m_lock_pthread, 0);
|
||||
#endif
|
||||
#if OMPI_SYS_ARCH_ATOMIC_H
|
||||
#if OMPI_HAVE_ATOMIC
|
||||
ompi_atomic_unlock(&m->m_lock_atomic);
|
||||
#endif
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ struct ompi_mutex_t {
|
||||
OBJ_CLASS_DECLARATION(ompi_mutex_t);
|
||||
|
||||
|
||||
#if defined(OMPI_SYS_ARCH_ATOMIC_H) && defined(OMPI_HAVE_POSIX_THREADS)
|
||||
#if defined(OMPI_HAVE_ATOMIC) && defined(OMPI_HAVE_POSIX_THREADS)
|
||||
|
||||
/*
|
||||
* ompi_mutex_* implemented using pthreads
|
||||
@ -110,7 +110,7 @@ static inline void ompi_mutex_atomic_unlock(ompi_mutex_t *m)
|
||||
}
|
||||
|
||||
|
||||
#elif defined(OMPI_SYS_ARCH_ATOMIC_H)
|
||||
#elif defined(OMPI_HAVE_ATOMIC)
|
||||
|
||||
/*
|
||||
* ompi_mutex_* and ompi_mutex_atomic_* implemented using atomic
|
||||
|
@ -5,6 +5,8 @@
|
||||
|
||||
include $(top_srcdir)/config/Makefile.options
|
||||
|
||||
libutil_la_CCASFLAGS = $(CPPFLAGS)
|
||||
|
||||
noinst_LTLIBRARIES = libutil.la
|
||||
|
||||
# Source code files
|
||||
@ -26,7 +28,7 @@ headers = \
|
||||
proc_info.h \
|
||||
os_path.h \
|
||||
os_create_dirpath.h \
|
||||
pow2.h \
|
||||
pow2.h \
|
||||
session_dir.h \
|
||||
strncpy.h
|
||||
|
||||
@ -48,7 +50,7 @@ libutil_la_SOURCES = \
|
||||
sys_info.c \
|
||||
os_path.c \
|
||||
os_create_dirpath.c \
|
||||
pow2.c \
|
||||
pow2.c \
|
||||
session_dir.c \
|
||||
strncpy.c
|
||||
|
||||
|
@ -9,17 +9,17 @@
|
||||
#ifndef __GNUC__
|
||||
|
||||
#if defined(__alpha__)
|
||||
# include "sys/alpha/atomic.s"
|
||||
# include "include/sys/alpha/atomic.s"
|
||||
#elif defined(__amd64__)
|
||||
# include "sys/amd64/atomic.s"
|
||||
# include "include/sys/amd64/atomic.s"
|
||||
#elif defined(__i386__)
|
||||
# include "sys/ia32/atomic.s"
|
||||
# include "include/sys/ia32/atomic.s"
|
||||
#elif defined(__ia64__)
|
||||
# include "sys/ia64/atomic.s"
|
||||
# include "include/sys/ia64/atomic.s"
|
||||
#elif defined(__POWERPC__)
|
||||
# include "sys/powerpc/atomic.s"
|
||||
# include "include/sys/powerpc/atomic.s"
|
||||
#elif defined(__sparc__) || defined(__sparc)
|
||||
# include "sys/sparc64/atomic.s"
|
||||
# include "include/sys/sparc64/atomic.s"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user