mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 19:23:03 +01:00
Clean the sources from VC6 hacks.
This commit is contained in:
parent
513804ae66
commit
1cdd4e4126
@ -87,9 +87,8 @@ AuthSspi::~AuthSspi()
|
|||||||
|
|
||||||
bool AuthSspi::checkAdminPrivilege(PCtxtHandle phContext) const
|
bool AuthSspi::checkAdminPrivilege(PCtxtHandle phContext) const
|
||||||
{
|
{
|
||||||
#if (defined(_MSC_VER) && _MSC_VER <= 1200) || defined (__GNUC__)
|
#if defined (__GNUC__)
|
||||||
// CVC: MSVC6 hack.
|
// ASF: MinGW hack.
|
||||||
// ASF: seems to be needed by MinGW too.
|
|
||||||
struct SecPkgContext_AccessToken
|
struct SecPkgContext_AccessToken
|
||||||
{
|
{
|
||||||
void* AccessToken;
|
void* AccessToken;
|
||||||
|
@ -67,7 +67,7 @@ public:
|
|||||||
counter_type value() const { return counter; }
|
counter_type value() const { return counter; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
# if (defined(_MSC_VER) && (_MSC_VER <= 1200)) || defined(MINGW)
|
# if defined(MINGW)
|
||||||
counter_type counter;
|
counter_type counter;
|
||||||
# else
|
# else
|
||||||
volatile counter_type counter;
|
volatile counter_type counter;
|
||||||
|
@ -584,14 +584,8 @@ public:
|
|||||||
|
|
||||||
Value& current() const { return (*curr)[curPos]; }
|
Value& current() const { return (*curr)[curPos]; }
|
||||||
|
|
||||||
// CVC: Here making this public is hack for MSVC6 that didn't acknowledge the
|
|
||||||
// friend declaration.
|
|
||||||
#if defined(_MSC_VER) && _MSC_VER <= 1200
|
|
||||||
public:
|
|
||||||
#else
|
|
||||||
private:
|
private:
|
||||||
#endif
|
|
||||||
|
|
||||||
// Returns true if current position is valid and already points to the given key.
|
// Returns true if current position is valid and already points to the given key.
|
||||||
// Note that we can't guarantie validity of current position if tree is accessed
|
// Note that we can't guarantie validity of current position if tree is accessed
|
||||||
// by different Accessor's. Therefore this method is private and can be used only
|
// by different Accessor's. Therefore this method is private and can be used only
|
||||||
|
@ -7122,7 +7122,7 @@ static SSHORT print_item(TEXT** s,
|
|||||||
// The bug appears in TCS DSQL_DOMAIN_12 and 13
|
// The bug appears in TCS DSQL_DOMAIN_12 and 13
|
||||||
//
|
//
|
||||||
const double value = (double) *(float*) var->sqldata;
|
const double value = (double) *(float*) var->sqldata;
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER <= 1200)) || defined(MINGW)
|
#if defined(MINGW)
|
||||||
if (value == 0) {
|
if (value == 0) {
|
||||||
sprintf(p, "% #*.*g ", length,
|
sprintf(p, "% #*.*g ", length,
|
||||||
(int) MIN(8, (length - 6)) - 1,
|
(int) MIN(8, (length - 6)) - 1,
|
||||||
@ -7198,7 +7198,7 @@ static SSHORT print_item(TEXT** s,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER <= 1200)) || defined(MINGW)
|
#if defined(MINGW)
|
||||||
if (value == 0) {
|
if (value == 0) {
|
||||||
sprintf(p, "% #*.*g ", length,
|
sprintf(p, "% #*.*g ", length,
|
||||||
(int) MIN(16, (length - 7)) - 1,
|
(int) MIN(16, (length - 7)) - 1,
|
||||||
|
@ -103,11 +103,7 @@
|
|||||||
|
|
||||||
using namespace Jrd;
|
using namespace Jrd;
|
||||||
|
|
||||||
#if defined _MSC_VER && _MSC_VER <= 1200
|
|
||||||
#include "../jrd/SimilarToMatcherVC6.h"
|
|
||||||
#else
|
|
||||||
#include "../jrd/SimilarToMatcher.h"
|
#include "../jrd/SimilarToMatcher.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -34,11 +34,7 @@ public:
|
|||||||
void getBytes(void* p, size_t size);
|
void getBytes(void* p, size_t size);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#if (defined(_MSC_VER) && _MSC_VER <= 1200)
|
|
||||||
enum { BUFFER_SIZE = 4096 };
|
|
||||||
#else
|
|
||||||
const static size_t BUFFER_SIZE = 4096;
|
const static size_t BUFFER_SIZE = 4096;
|
||||||
#endif
|
|
||||||
|
|
||||||
int bufferPos;
|
int bufferPos;
|
||||||
char buffer[BUFFER_SIZE];
|
char buffer[BUFFER_SIZE];
|
||||||
|
@ -2908,19 +2908,7 @@ static dsc* evlUuidToChar(Jrd::thread_db* tdbb, const SysFunction* function, Jrd
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER <= 1200))
|
|
||||||
SysFunction::SysFunction(const char* s, int minCount, int maxCount, SetParamsFunc sp, MakeFunc mf, EvlFunc ef, void* v)
|
|
||||||
: name(s), minArgCount(minCount), maxArgCount(maxCount), setParamsFunc(sp), makeFunc(mf), evlFunc(ef), misc(v)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER <= 1200))
|
|
||||||
#define SF(a, b, c, d, e, f, g) SysFunction(a, b, c, d, e, f, g)
|
|
||||||
#else
|
|
||||||
#define SF(a, b, c, d, e, f, g) {a, b, c, d, e, f, g}
|
#define SF(a, b, c, d, e, f, g) {a, b, c, d, e, f, g}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
typedef StdMathFunc VoidPtrStdMathFunc;
|
typedef StdMathFunc VoidPtrStdMathFunc;
|
||||||
|
@ -50,10 +50,6 @@ public:
|
|||||||
typedef void (*MakeFunc)(DataTypeUtilBase* dataTypeUtil, const SysFunction* function, dsc*, int, const dsc**);
|
typedef void (*MakeFunc)(DataTypeUtilBase* dataTypeUtil, const SysFunction* function, dsc*, int, const dsc**);
|
||||||
typedef dsc* (*EvlFunc)(Jrd::thread_db*, const SysFunction* function, Jrd::jrd_nod*, Jrd::impure_value*);
|
typedef dsc* (*EvlFunc)(Jrd::thread_db*, const SysFunction* function, Jrd::jrd_nod*, Jrd::impure_value*);
|
||||||
|
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER <= 1200))
|
|
||||||
SysFunction(const char* s, int minCount, int maxCount, SetParamsFunc sp, MakeFunc mf, EvlFunc ef, void* v);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const Firebird::MetaName name;
|
const Firebird::MetaName name;
|
||||||
int minArgCount;
|
int minArgCount;
|
||||||
int maxArgCount; // -1 for no limit
|
int maxArgCount; // -1 for no limit
|
||||||
|
@ -2377,9 +2377,8 @@ static inline BOOL switchToThread()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// VC6 has the wrong declaration for the operating system function.
|
// MinGW has the wrong declaration for the operating system function.
|
||||||
// MinGW as well
|
#if defined __GNUC__
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER <= 1200)) || defined __GNUC__
|
|
||||||
// Cast away volatile
|
// Cast away volatile
|
||||||
#define FIX_TYPE(arg) const_cast<LPLONG>(arg)
|
#define FIX_TYPE(arg) const_cast<LPLONG>(arg)
|
||||||
#else
|
#else
|
||||||
|
@ -285,10 +285,6 @@ void PIO_extend(Database* dbb, jrd_file* main_file, const ULONG extPages, const
|
|||||||
*
|
*
|
||||||
**************************************/
|
**************************************/
|
||||||
|
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER <= 1200)) // || defined(MINGW)
|
|
||||||
const DWORD INVALID_SET_FILE_POINTER = 0xFFFFFFFF;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// hvlad: prevent other reading\writing threads from changing file pointer.
|
// hvlad: prevent other reading\writing threads from changing file pointer.
|
||||||
// As we open file without FILE_FLAG_OVERLAPPED, ReadFile\WriteFile calls
|
// As we open file without FILE_FLAG_OVERLAPPED, ReadFile\WriteFile calls
|
||||||
// will change file pointer we set here and file truncation instead of file
|
// will change file pointer we set here and file truncation instead of file
|
||||||
|
@ -132,13 +132,6 @@ struct dba_fil
|
|||||||
SCHAR fil_string[1]; /* Expanded file name */
|
SCHAR fil_string[1]; /* Expanded file name */
|
||||||
};
|
};
|
||||||
|
|
||||||
// CVC: I need to compile in MSVC6 that doesn't accept FB_UINT64 to double conversion.
|
|
||||||
#if defined(_WIN32) && defined(_MSC_VER) && _MSC_VER == 1200
|
|
||||||
#define CAST64 (SINT64)
|
|
||||||
#else
|
|
||||||
#define CAST64
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static char* alloc(size_t);
|
static char* alloc(size_t);
|
||||||
static void analyze_data(dba_rel*, bool);
|
static void analyze_data(dba_rel*, bool);
|
||||||
static bool analyze_data_page(dba_rel*, const data_page*, bool);
|
static bool analyze_data_page(dba_rel*, const data_page*, bool);
|
||||||
@ -750,7 +743,7 @@ int gstat(Firebird::UtilSvc* uSvc)
|
|||||||
// msg 11: " Primary pointer page: %ld, Index root page: %ld"
|
// msg 11: " Primary pointer page: %ld, Index root page: %ld"
|
||||||
if (sw_record) {
|
if (sw_record) {
|
||||||
double average = (relation->rel_records) ?
|
double average = (relation->rel_records) ?
|
||||||
(double) CAST64 relation->rel_record_space /
|
(double) relation->rel_record_space /
|
||||||
relation->rel_records : 0.0;
|
relation->rel_records : 0.0;
|
||||||
sprintf((char*) buf, "%.2f", average);
|
sprintf((char*) buf, "%.2f", average);
|
||||||
uSvc->printf(
|
uSvc->printf(
|
||||||
@ -759,7 +752,7 @@ int gstat(Firebird::UtilSvc* uSvc)
|
|||||||
// dba_print(18, SafeArg() << buf << relation->rel_records);
|
// dba_print(18, SafeArg() << buf << relation->rel_records);
|
||||||
// msg 18: " Average record length: %s, total records: %ld
|
// msg 18: " Average record length: %s, total records: %ld
|
||||||
average = (relation->rel_versions) ?
|
average = (relation->rel_versions) ?
|
||||||
(double) CAST64 relation->rel_version_space /
|
(double) relation->rel_version_space /
|
||||||
relation->rel_versions : 0.0;
|
relation->rel_versions : 0.0;
|
||||||
sprintf((char*) buf, "%.2f", average);
|
sprintf((char*) buf, "%.2f", average);
|
||||||
uSvc->printf(
|
uSvc->printf(
|
||||||
@ -772,7 +765,7 @@ int gstat(Firebird::UtilSvc* uSvc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const double average = (relation->rel_data_pages) ?
|
const double average = (relation->rel_data_pages) ?
|
||||||
(double) CAST64 relation->rel_total_space * 100 /
|
(double) relation->rel_total_space * 100 /
|
||||||
((double) relation->rel_data_pages *
|
((double) relation->rel_data_pages *
|
||||||
(tddba->page_size - DPG_SIZE)) : 0.0;
|
(tddba->page_size - DPG_SIZE)) : 0.0;
|
||||||
sprintf((char*) buf, "%.0f%%", average);
|
sprintf((char*) buf, "%.0f%%", average);
|
||||||
@ -792,7 +785,7 @@ int gstat(Firebird::UtilSvc* uSvc)
|
|||||||
index->idx_leaf_buckets << index->idx_nodes);
|
index->idx_leaf_buckets << index->idx_nodes);
|
||||||
// msg 15: \tDepth: %d, leaf buckets: %ld, nodes: %ld
|
// msg 15: \tDepth: %d, leaf buckets: %ld, nodes: %ld
|
||||||
const double average = (index->idx_nodes) ?
|
const double average = (index->idx_nodes) ?
|
||||||
(double) CAST64 index->idx_data_length / index->idx_nodes : 0;
|
(double) index->idx_data_length / index->idx_nodes : 0;
|
||||||
sprintf((char*) buf, "%.2f", average);
|
sprintf((char*) buf, "%.2f", average);
|
||||||
dba_print(16, SafeArg() << buf << index->idx_total_duplicates <<
|
dba_print(16, SafeArg() << buf << index->idx_total_duplicates <<
|
||||||
index->idx_max_duplicates);
|
index->idx_max_duplicates);
|
||||||
|
Loading…
Reference in New Issue
Block a user