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

Fixes for Android port

This commit is contained in:
AlexPeshkoff 2020-05-18 16:30:12 +03:00
parent 976d2bede3
commit a94107e410
4 changed files with 8 additions and 43 deletions

View File

@ -234,9 +234,7 @@ $(TOMMATH_LIB): $(TOM_Objs)
.PHONY: tomcrypt
TOMCRYPT_LIB=$(LIB)/libtomcrypt.a
TOM_Src:=hashes/md5.c hashes/sha1.c hashes/sha2/sha256.c hashes/sha2/sha512.c misc/crypt/crypt_argchk.c
TOM_Src:=$(addprefix ../extern/libtomcrypt/src/, $(TOM_Src))
TOM_Src:=$(shell find ../extern/libtomcrypt/src -name '*.c' -print)
TOM_Objs=$(call doObjects,$(TOM_Src))
tomcrypt: $(TOMCRYPT_LIB)

View File

@ -687,11 +687,13 @@ static void brio_fini(BurpGlobals* tdgbl)
static void checkCompression()
{
#ifdef HAVE_ZLIB_H
if (!zlib())
{
(Firebird::Arg::Gds(isc_random) << "Compession support library not loaded" <<
Firebird::Arg::StatusVector(zlib().status)).raise();
}
#endif
}
@ -710,6 +712,7 @@ void MVOL_init_read(const char* file_name, USHORT* format)
if (tdgbl->gbl_sw_zip)
{
#ifdef HAVE_ZLIB_H
z_stream& strm = tdgbl->gbl_stream;
strm.zalloc = Firebird::ZLib::allocFunc;
@ -720,9 +723,8 @@ void MVOL_init_read(const char* file_name, USHORT* format)
checkCompression();
int ret = zlib().inflateInit(&strm);
if (ret != Z_OK)
{
BURP_error(383, true, SafeArg() << ret);
}
#endif
BURP_error(383, true, SafeArg() << 127);
}
}
@ -776,6 +778,7 @@ void MVOL_init_write(const char* file_name)
tdgbl->gbl_io_cnt = ZC_BUFSIZE;
tdgbl->gbl_io_ptr = tdgbl->gbl_compress_buffer;
#ifdef HAVE_ZLIB_H
if (tdgbl->gbl_sw_zip)
{
z_stream& strm = tdgbl->gbl_stream;
@ -789,6 +792,7 @@ void MVOL_init_write(const char* file_name)
BURP_error(384, true, SafeArg() << ret);
strm.next_out = Z_NULL;
}
#endif
}
void mvol_init_write(BurpGlobals* tdgbl, const char* file_name, int* cnt, UCHAR** ptr)

View File

@ -58,11 +58,7 @@
#include <memory.h>
#ifdef USE_SYSTEM_NEW
#define OOM_EXCEPTION std::bad_alloc
#else
#define OOM_EXCEPTION Firebird::BadAlloc
#endif
#if __cplusplus >= 201103L
#define FB_NO_THROW_SPECIFIER
@ -401,22 +397,6 @@ extern void operator delete[](void* mem) FB_NOTHROW;
#endif // DEBUG_GDS_ALLOC
#ifndef USE_SYSTEM_NEW
// We must define placement operators NEW & DELETE ourselves
inline void* operator new(size_t s, void* place) FB_NOTHROW
{
return place;
}
inline void* operator new[](size_t s, void* place) FB_NOTHROW
{
return place;
}
inline void operator delete(void*, void*) FB_NOTHROW
{ }
inline void operator delete[](void*, void*) FB_NOTHROW
{ }
#endif
namespace Firebird
{
// Global storage makes it possible to use new and delete for classes,

View File

@ -33,13 +33,7 @@
#include <stddef.h>
#include <string.h>
#ifndef ANDROID
#define USE_SYSTEM_NEW
#endif
#ifdef USE_SYSTEM_NEW
#include <new>
#endif
#include "fb_types.h"
#include "firebird/Interface.h"
@ -85,21 +79,10 @@ public:
};
// Used in MemoryPool
#ifdef USE_SYSTEM_NEW
class BadAlloc : public std::bad_alloc, public Exception
{
public:
BadAlloc() throw() : std::bad_alloc(), Exception() { }
#else // USE_SYSTEM_NEW
class BadAlloc : public Exception
{
public:
BadAlloc() throw() : Exception() { }
#endif // USE_SYSTEM_NEW
public:
virtual void stuffByException(StaticStatusVector& status_vector) const throw();
virtual const char* what() const throw();
static void raise();