8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 20:03:02 +01:00

HPUX port

This commit is contained in:
alexpeshkoff 2009-06-05 10:04:45 +00:00
parent 9e65a6e156
commit 5ac9a5e003
2 changed files with 81 additions and 4 deletions

View File

@ -228,22 +228,40 @@ dnl ibm xlC has many invocations, like xlC, xlc++, or xlc_r7
;; ;;
ia64-*-hpux*) 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 PLATFORM=HPUX
AC_DEFINE(HPUX, 1, [Define this if OS is HP-UX]) AC_DEFINE(HPUX, 1, [Define this if OS is HP-UX])
EDITLINE_FLG=Y EDITLINE_FLG=Y
SHRLIB_EXT=sl 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 RT_LIB_CHECK=true
;; ;;
*-*-hpux*) *-*-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 PLATFORM=HPUX
AC_DEFINE(HPUX, 1, [Define this if OS is HP-UX]) AC_DEFINE(HPUX, 1, [Define this if OS is HP-UX])
EDITLINE_FLG=Y EDITLINE_FLG=Y
SHRLIB_EXT=sl SHRLIB_EXT=sl
libdir=/usr/lib/pa20_64 dnl libdir=/usr/lib/pa20_64
RT_LIB_CHECK=true RT_LIB_CHECK=true
;; ;;

View File

@ -205,6 +205,65 @@ private:
} // namespace Firebird } // 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) #elif defined(SOLARIS)
#include <atomic.h> #include <atomic.h>