mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 16:03:02 +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
|
||||
{
|
||||
#if (defined(_MSC_VER) && _MSC_VER <= 1200) || defined (__GNUC__)
|
||||
// CVC: MSVC6 hack.
|
||||
// ASF: seems to be needed by MinGW too.
|
||||
#if defined (__GNUC__)
|
||||
// ASF: MinGW hack.
|
||||
struct SecPkgContext_AccessToken
|
||||
{
|
||||
void* AccessToken;
|
||||
|
@ -67,7 +67,7 @@ public:
|
||||
counter_type value() const { return counter; }
|
||||
|
||||
private:
|
||||
# if (defined(_MSC_VER) && (_MSC_VER <= 1200)) || defined(MINGW)
|
||||
# if defined(MINGW)
|
||||
counter_type counter;
|
||||
# else
|
||||
volatile counter_type counter;
|
||||
|
@ -584,14 +584,8 @@ public:
|
||||
|
||||
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:
|
||||
#endif
|
||||
|
||||
|
||||
// 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
|
||||
// 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
|
||||
//
|
||||
const double value = (double) *(float*) var->sqldata;
|
||||
#if (defined(_MSC_VER) && (_MSC_VER <= 1200)) || defined(MINGW)
|
||||
#if defined(MINGW)
|
||||
if (value == 0) {
|
||||
sprintf(p, "% #*.*g ", length,
|
||||
(int) MIN(8, (length - 6)) - 1,
|
||||
@ -7198,7 +7198,7 @@ static SSHORT print_item(TEXT** s,
|
||||
}
|
||||
}
|
||||
else {
|
||||
#if (defined(_MSC_VER) && (_MSC_VER <= 1200)) || defined(MINGW)
|
||||
#if defined(MINGW)
|
||||
if (value == 0) {
|
||||
sprintf(p, "% #*.*g ", length,
|
||||
(int) MIN(16, (length - 7)) - 1,
|
||||
|
@ -103,11 +103,7 @@
|
||||
|
||||
using namespace Jrd;
|
||||
|
||||
#if defined _MSC_VER && _MSC_VER <= 1200
|
||||
#include "../jrd/SimilarToMatcherVC6.h"
|
||||
#else
|
||||
#include "../jrd/SimilarToMatcher.h"
|
||||
#endif
|
||||
|
||||
|
||||
namespace {
|
||||
|
@ -34,11 +34,7 @@ public:
|
||||
void getBytes(void* p, size_t size);
|
||||
|
||||
private:
|
||||
#if (defined(_MSC_VER) && _MSC_VER <= 1200)
|
||||
enum { BUFFER_SIZE = 4096 };
|
||||
#else
|
||||
const static size_t BUFFER_SIZE = 4096;
|
||||
#endif
|
||||
|
||||
int bufferPos;
|
||||
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}
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
typedef StdMathFunc VoidPtrStdMathFunc;
|
||||
|
@ -50,10 +50,6 @@ public:
|
||||
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*);
|
||||
|
||||
#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;
|
||||
int minArgCount;
|
||||
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 as well
|
||||
#if (defined(_MSC_VER) && (_MSC_VER <= 1200)) || defined __GNUC__
|
||||
// MinGW has the wrong declaration for the operating system function.
|
||||
#if defined __GNUC__
|
||||
// Cast away volatile
|
||||
#define FIX_TYPE(arg) const_cast<LPLONG>(arg)
|
||||
#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.
|
||||
// As we open file without FILE_FLAG_OVERLAPPED, ReadFile\WriteFile calls
|
||||
// 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 */
|
||||
};
|
||||
|
||||
// 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 void analyze_data(dba_rel*, 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"
|
||||
if (sw_record) {
|
||||
double average = (relation->rel_records) ?
|
||||
(double) CAST64 relation->rel_record_space /
|
||||
(double) relation->rel_record_space /
|
||||
relation->rel_records : 0.0;
|
||||
sprintf((char*) buf, "%.2f", average);
|
||||
uSvc->printf(
|
||||
@ -759,7 +752,7 @@ int gstat(Firebird::UtilSvc* uSvc)
|
||||
// dba_print(18, SafeArg() << buf << relation->rel_records);
|
||||
// msg 18: " Average record length: %s, total records: %ld
|
||||
average = (relation->rel_versions) ?
|
||||
(double) CAST64 relation->rel_version_space /
|
||||
(double) relation->rel_version_space /
|
||||
relation->rel_versions : 0.0;
|
||||
sprintf((char*) buf, "%.2f", average);
|
||||
uSvc->printf(
|
||||
@ -772,7 +765,7 @@ int gstat(Firebird::UtilSvc* uSvc)
|
||||
}
|
||||
|
||||
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 *
|
||||
(tddba->page_size - DPG_SIZE)) : 0.0;
|
||||
sprintf((char*) buf, "%.0f%%", average);
|
||||
@ -792,7 +785,7 @@ int gstat(Firebird::UtilSvc* uSvc)
|
||||
index->idx_leaf_buckets << index->idx_nodes);
|
||||
// msg 15: \tDepth: %d, leaf buckets: %ld, nodes: %ld
|
||||
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);
|
||||
dba_print(16, SafeArg() << buf << index->idx_total_duplicates <<
|
||||
index->idx_max_duplicates);
|
||||
|
Loading…
Reference in New Issue
Block a user