8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 18:03:04 +01:00

Backported unregistered fix from HEAD - move bodies of virtual functions from .h to .cpp file.

This commit is contained in:
alexpeshkoff 2009-10-08 07:59:36 +00:00
parent 267439018d
commit 4086cfbab3
5 changed files with 36 additions and 28 deletions

View File

@ -85,8 +85,7 @@ else
$(LIB_LINK_RPATH)$(FirebirdInstallPrefix)/lib -o $@ $^ @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
endif
# ib_util
# this is plain-C library, therefore CLIENTLIB_LINK
# without STATIC_CXXSUPPORT_LIB is used
# this is plain-C library, therefore use CLIENTLIB_LINK
lib_ib_util: $(LIBIBUTIL_SO)

View File

@ -111,13 +111,13 @@ endif
$(LIBFBCLIENT_SO): $(FBCLIENT_Objects)
ifeq ($(PLATFORM),DARWIN)
$(CLIENTLIB_LINK) $(LINK_FIREBIRD_CLIENT_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_LINK_IMPLIB) \
$(LIB_LINK) $(LINK_FIREBIRD_CLIENT_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_LINK_IMPLIB) \
$(LIB_CLIENT_LINK_OPTIONS) $(LIB_LINK_SONAME) \
-o $@ $^ $(SO_LINK_LIBS) $(STATIC_CXXSUPPORT_LIB) @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
-o $@ $^ $(SO_LINK_LIBS) $(STATIC_CXXSUPPORT) @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
else
$(CLIENTLIB_LINK) $(LINK_FIREBIRD_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_LINK_IMPLIB) \
$(LIB_LINK) $(LINK_FIREBIRD_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_LINK_IMPLIB) \
$(LIB_LINK_SONAME)$(ClientLibraryNameMajor) $(LIB_LINK_RPATH)$(FirebirdInstallPrefix)/lib \
-o $@ $^ $(SO_LINK_LIBS) $(STATIC_CXXSUPPORT_LIB) @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
-o $@ $^ $(SO_LINK_LIBS) $(STATIC_CXXSUPPORT) @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
endif
AllObjects = $(FBCLIENT_Objects)

View File

@ -269,7 +269,7 @@ LINK_FBINTL_SYMBOLS = $(LIB_LINK_MAPFILE)$(ROOT)/builds/posix/fbintl.vers
FB_SUPER_SERVER = $(BIN)/fbserver$(EXEC_EXT)
FB_CLASSIC_SERVER = $(BIN)/fb_inet_server$(EXEC_EXT)
STATIC_CXXSUPPORT_LIB = -lsupc++ -lgcc_eh
STATIC_CXXSUPPORT = -static-libgcc
# From utilities
CREATE_DB = $(BIN)/create_db$(EXEC_EXT)

View File

@ -111,6 +111,10 @@ void StringsBuffer::makePermanentVector(ISC_STATUS* perm, const ISC_STATUS* tran
}
}
// ********************************* Exception *******************************
Exception::~Exception() throw() { }
/********************************* status_exception *******************************/
status_exception::status_exception() throw() :
@ -240,6 +244,11 @@ ISC_STATUS status_exception::stuff_exception(ISC_STATUS* const status_vector, St
return status_vector[1];
}
const char* status_exception::what() const throw()
{
return "Firebird::status_exception";
}
/********************************* BadAlloc ****************************/
void BadAlloc::raise()
@ -258,6 +267,11 @@ ISC_STATUS BadAlloc::stuff_exception(ISC_STATUS* const status_vector, StringsBuf
return status_vector[1];
}
const char* BadAlloc::what() const throw()
{
return "Firebird::BadAlloc";
}
/********************************* LongJump ****************************/
void LongJump::raise()
@ -291,6 +305,11 @@ ISC_STATUS LongJump::stuff_exception(ISC_STATUS* const status_vector, StringsBuf
return status_vector[1];
}
const char* LongJump::what() const throw()
{
return "Firebird::LongJump";
}
/********************************* system_call_failed ****************************/
system_call_failed::system_call_failed(const char* v_syscall, int v_error_code) :
@ -331,21 +350,17 @@ fatal_exception::fatal_exception(const char* message) :
set_status(temp, false);
}
// Moved to the header due to gpre. Gpre non-static can't receive it, but we
// want to avoid problems with picky compilers that can't find what().
// We can't link this file into normal gpre.
// Keep in sync with the constructor above, please; "message" becomes 4th element
// after initialization of status vector.
//const char* fatal_exception::what() const throw()
//{
// return reinterpret_cast<const char*>(value()[3]);
//}
void fatal_exception::raise(const char* message)
{
throw fatal_exception(message);
}
// after initialization of status vector in constructor.
const char* fatal_exception::what() const throw()
{
return reinterpret_cast<const char*>(value()[3]);
}
/************************** exception handling routines ***************************/
const char* status_string(const char* string)

View File

@ -77,7 +77,7 @@ class Exception
protected:
Exception() throw() { }
public:
virtual ~Exception() throw() { }
virtual ~Exception() throw();
virtual ISC_STATUS stuff_exception(ISC_STATUS* const status_vector, StringsBuffer* sb = NULL) const throw() = 0;
virtual const char* what() const throw() = 0;
};
@ -87,7 +87,7 @@ class LongJump : public Exception
{
public:
virtual ISC_STATUS stuff_exception(ISC_STATUS* const status_vector, StringsBuffer* sb = NULL) const throw();
virtual const char* what() const throw() { return "Firebird::LongJump"; }
virtual const char* what() const throw();
static void raise();
LongJump() throw() : Exception() { }
};
@ -97,7 +97,7 @@ class BadAlloc : public Exception
{
public:
virtual ISC_STATUS stuff_exception(ISC_STATUS* const status_vector, StringsBuffer* sb = NULL) const throw();
virtual const char* what() const throw() { return "Firebird::BadAlloc"; }
virtual const char* what() const throw();
static void raise();
BadAlloc() throw() : Exception() { }
};
@ -112,7 +112,7 @@ public:
virtual ~status_exception() throw();
virtual ISC_STATUS stuff_exception(ISC_STATUS* const status_vector, StringsBuffer* sb = NULL) const throw();
virtual const char* what() const throw() { return "Firebird::status_exception"; }
virtual const char* what() const throw();
const ISC_STATUS* value() const throw() { return m_status_vector; }
@ -156,18 +156,12 @@ public:
}
};
// Moved what() here due to gpre. Didn't want to use macros for gpre_static.
class fatal_exception : public status_exception
{
public:
explicit fatal_exception(const char* message);
static void raiseFmt(const char* format, ...);
// Keep in sync with the constructor above, please; "message" becomes 4th element
// after initialization of status vector in constructor.
const char* what() const throw()
{
return reinterpret_cast<const char*>(value()[3]);
}
const char* what() const throw();
static void raise(const char* message);
};