mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 16:43:03 +01:00
HPUX port
This commit is contained in:
parent
9e65a6e156
commit
5ac9a5e003
26
configure.in
26
configure.in
@ -228,22 +228,40 @@ dnl ibm xlC has many invocations, like xlC, xlc++, or xlc_r7
|
||||
;;
|
||||
|
||||
ia64-*-hpux*)
|
||||
MAKEFILE_PREFIX=hpux_ia64
|
||||
comp=`echo "$CXX" | cut -c1-3`
|
||||
case $comp in
|
||||
aCC) MAKEFILE_PREFIX=hpux-aCC ;
|
||||
ICU_PLATFORM=HP-UX11ACC ;
|
||||
AC_DEFINE(HPUXACC, 1, [Define this if using native compilers])
|
||||
libdir=/opt/aCC/lib ;;
|
||||
*) MAKEFILE_PREFIX=hpux_ia64 ;
|
||||
libdir=/opt/hp-gcc-4.3.1/lib ;;
|
||||
esac
|
||||
INSTALL_PREFIX=hpux
|
||||
PLATFORM=HPUX
|
||||
AC_DEFINE(HPUX, 1, [Define this if OS is HP-UX])
|
||||
EDITLINE_FLG=Y
|
||||
SHRLIB_EXT=sl
|
||||
libdir=/usr/lib/pa20_64
|
||||
dnl libdir=/opt/hp-gcc-4.3.1/lib
|
||||
dnl libdir=/usr/lib/pa20_64
|
||||
RT_LIB_CHECK=true
|
||||
;;
|
||||
|
||||
*-*-hpux*)
|
||||
MAKEFILE_PREFIX=hpux
|
||||
comp=`echo "$CXX" | cut -c1-3`
|
||||
case $comp in
|
||||
aCC) MAKEFILE_PREFIX=hpux-aCC ;
|
||||
ICU_PLATFORM=HP-UX11ACC ;
|
||||
AC_DEFINE(HPUXACC, 1, [Define this if using native compilers])
|
||||
libdir=/opt/aCC/lib ;;
|
||||
*) MAKEFILE_PREFIX=hpux ;
|
||||
libdir=/opt/hp-gcc-4.3.1/lib ;;
|
||||
esac
|
||||
PLATFORM=HPUX
|
||||
AC_DEFINE(HPUX, 1, [Define this if OS is HP-UX])
|
||||
EDITLINE_FLG=Y
|
||||
SHRLIB_EXT=sl
|
||||
libdir=/usr/lib/pa20_64
|
||||
dnl libdir=/usr/lib/pa20_64
|
||||
RT_LIB_CHECK=true
|
||||
;;
|
||||
|
||||
|
@ -205,6 +205,65 @@ private:
|
||||
|
||||
} // namespace Firebird
|
||||
|
||||
#elif defined(HPUX)
|
||||
|
||||
#include <atomic.h>
|
||||
|
||||
namespace Firebird {
|
||||
|
||||
// HPUX version - uses atomic API library
|
||||
class AtomicCounter
|
||||
{
|
||||
public:
|
||||
typedef uint32_t counter_type;
|
||||
|
||||
explicit AtomicCounter(counter_type value = 0) : counter(value) {}
|
||||
~AtomicCounter() {}
|
||||
|
||||
counter_type exchangeAdd(counter_type value)
|
||||
{
|
||||
counter_type old = counter;
|
||||
do
|
||||
{
|
||||
old = counter;
|
||||
errno = 0;
|
||||
} while (atomic_cas_32(&counter, old, old + value) != old);
|
||||
return old;
|
||||
}
|
||||
|
||||
counter_type operator +=(counter_type value)
|
||||
{
|
||||
return exchangeAdd(value) + value;
|
||||
}
|
||||
|
||||
counter_type operator -=(counter_type value)
|
||||
{
|
||||
return exchangeAdd(-value) - value;
|
||||
}
|
||||
|
||||
counter_type operator ++()
|
||||
{
|
||||
return atomic_inc_32(&counter) + 1;
|
||||
}
|
||||
|
||||
counter_type operator --()
|
||||
{
|
||||
return atomic_dec_32(&counter) - 1;
|
||||
}
|
||||
|
||||
counter_type value() const { return counter; }
|
||||
|
||||
counter_type setValue(counter_type val)
|
||||
{
|
||||
return atomic_swap_32(&counter, val);
|
||||
}
|
||||
|
||||
private:
|
||||
volatile counter_type counter;
|
||||
};
|
||||
|
||||
} // namespace Firebird
|
||||
|
||||
#elif defined(SOLARIS)
|
||||
|
||||
#include <atomic.h>
|
||||
|
Loading…
Reference in New Issue
Block a user