From 234fdb0e43561472477c0493c1078a4de95ca7af Mon Sep 17 00:00:00 2001 From: kkuznetsov Date: Thu, 13 May 2004 14:05:00 +0000 Subject: [PATCH] Add check for caddr_t to fix compile error on Solaris munmap, some more warnings to prefix solx86gcc, comment historycal pragmas --- builds/posix/prefix.solx86gcc | 6 +++--- configure.in | 3 ++- src/common/classes/alloc.cpp | 8 +++++++- src/include/firebird.h | 4 +++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/builds/posix/prefix.solx86gcc b/builds/posix/prefix.solx86gcc index 1426702299..77e8bb687e 100644 --- a/builds/posix/prefix.solx86gcc +++ b/builds/posix/prefix.solx86gcc @@ -14,11 +14,11 @@ # # All Rights Reserved. # Contributor(s): __Konstantin Kuznetsov___________________________________. -# This file can be used to build FB on Solaris 8 x 86 with gcc 3.3.3 and bash +# This file can be used to build FB on Solaris 2.6 x 86 with gcc 3.3.3 and bash # # Use SOLX86 to identify x86 version of Solaris. Neil McCalden # -# $Id: prefix.solx86gcc,v 1.9 2004-05-06 11:40:48 kkuznetsov Exp $ +# $Id: prefix.solx86gcc,v 1.10 2004-05-13 14:05:00 kkuznetsov Exp $ # # Start of file prefix.solaris X 86 : $(VERSION) $(PLATFORM) # 2 Oct 2002, Nickolay Samofatov - Major Cleanup @@ -26,7 +26,7 @@ #FirebirdInstallPrefix = @prefix@ -WARNINGS=-Wall -W -Wno-unused -Wno-parentheses -Wno-switch +WARNINGS=-Wall -W -Wno-unused -Wno-parentheses -Wno-switch -Wwrite-strings COMM_SOLX_FLAGS:=-DSOLARIS -DSOLARIS26 -DSOLARIS_MT -DSOLX86 -DBSD_COMP -fno-omit-frame-pointer -fmessage-length=0 -MMD -p -fPIC #SFIO= /export/home/interbase/SfIO diff --git a/configure.in b/configure.in index 5507d74b23..49ae4b2275 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -dnl $Id: configure.in,v 1.198 2004-05-03 11:31:54 eku Exp $ +dnl $Id: configure.in,v 1.199 2004-05-13 14:04:47 kkuznetsov Exp $ dnl ############################# INITIALISATION ############################### @@ -553,6 +553,7 @@ case "$PLATFORM" in dnl kkuznetsov: Solaris always check for -lnsl AC_CHECK_LIB(nsl, gethostname, XE_APPEND(-lnsl,LIBS)) AC_CHECK_LIB(thread, main) + AC_CHECK_TYPES([caddr_t]) AC_ARG_WITH(sfio, AC_HELP_STRING([--with-sfio=PATH], diff --git a/src/common/classes/alloc.cpp b/src/common/classes/alloc.cpp index 29359e7844..76a56215de 100644 --- a/src/common/classes/alloc.cpp +++ b/src/common/classes/alloc.cpp @@ -32,7 +32,7 @@ * Contributor(s): * * - * $Id: alloc.cpp,v 1.50 2004-05-12 19:17:09 brodsom Exp $ + * $Id: alloc.cpp,v 1.51 2004-05-13 14:04:51 kkuznetsov Exp $ * */ @@ -339,8 +339,14 @@ void MemoryPool::external_free(void *blk, size_t &size) { system_call_failed::raise("VirtualFree"); #elif defined HAVE_MMAP size = FB_ALIGN(size, map_page_size); +#if (defined SOLARIS) and (defined HAVE_CADDR_T) + if (munmap((caddr_t) blk, size)) + system_call_failed::raise("munmap"); + +#else if (munmap(blk, size)) system_call_failed::raise("munmap"); +#endif /*Solaris*/ #else ::free(blk); #endif diff --git a/src/include/firebird.h b/src/include/firebird.h index c1a18e0472..7913aa0940 100644 --- a/src/include/firebird.h +++ b/src/include/firebird.h @@ -30,7 +30,7 @@ * John Bellardo * * - * $Id: firebird.h,v 1.18 2004-03-25 23:12:44 skidder Exp $ + * $Id: firebird.h,v 1.19 2004-05-13 14:04:55 kkuznetsov Exp $ * */ @@ -43,8 +43,10 @@ #define FB_DLL_EXPORT #endif #if defined(SOLX86) +/* this pragmas is used only with gcc 2.95! #define __PRAGMA_REDEFINE_EXTNAME #define __EXTENSIONS__ +*/ #endif //