Skip to content

Commit 9b71e12

Browse files
committed
misc src updates
1 parent bdf16d7 commit 9b71e12

File tree

14 files changed

+30
-21
lines changed

14 files changed

+30
-21
lines changed

src/common/classes/FpeControl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define CLASSES_FPE_CONTROL_H
3131

3232
#include <math.h>
33-
#if defined(WIN_NT)
33+
#if defined(_MSC_VER)
3434
#include <float.h>
3535
#else
3636
#include <fenv.h>
@@ -78,7 +78,7 @@ class FpeControl
7878
}
7979
}
8080

81-
#if defined(WIN_NT)
81+
#if defined(_MSC_VER)
8282
static void maskAll() noexcept
8383
{
8484
_clearfp(); // always call _clearfp() before setting control word
@@ -215,7 +215,7 @@ class FpeControl
215215

216216
inline bool isNegativeInf(double x)
217217
{
218-
#ifdef WIN_NT
218+
#ifdef _MSC_VER
219219
return _fpclass(x) == _FPCLASS_NINF;
220220
#else
221221
return x == -INFINITY;

src/common/isc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,15 @@ class SecurityAttributes
147147
if (!InitializeSecurityDescriptor(p_security_desc, SECURITY_DESCRIPTOR_REVISION) ||
148148
!SetSecurityDescriptorDacl(p_security_desc, TRUE, NULL, FALSE))
149149
{
150-
delete p_security_desc;
150+
operator delete(p_security_desc);
151151
attributes.lpSecurityDescriptor = NULL;
152152
}
153153
}
154154

155155
~SecurityAttributes()
156156
{
157157
if (attributes.lpSecurityDescriptor)
158-
delete attributes.lpSecurityDescriptor;
158+
operator delete(attributes.lpSecurityDescriptor);
159159
}
160160

161161
operator LPSECURITY_ATTRIBUTES()

src/common/isc_sync.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1847,7 +1847,11 @@ SharedMemoryBase::SharedMemoryBase(const TEXT* filename, ULONG length, IpcObject
18471847
}
18481848

18491849
PathName mappedName;
1850+
#ifdef MINGW
1851+
if (!getMappedFileName(address, mappedName))
1852+
#else
18501853
if (!getMappedFileName(address, mappedName) || mappedName != expanded_filename)
1854+
#endif
18511855
{
18521856
UnmapViewOfFile(address);
18531857
CloseHandle(file_obj);
@@ -2096,7 +2100,7 @@ static const int DEFAULT_INTERLOCKED_SPIN_COUNT_SMP = 200;
20962100

20972101
static SLONG pid = 0;
20982102

2099-
typedef WINBASEAPI BOOL (WINAPI *pfnSwitchToThread) ();
2103+
typedef BOOL (WINAPI *pfnSwitchToThread) ();
21002104
static inline BOOL switchToThread()
21012105
{
21022106
static pfnSwitchToThread fnSwitchToThread = NULL;

src/common/os/guid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Guid
6666
{
6767
// Some versions of MSVC cannot recognize hh specifier but MSVC 2015 has it
6868
static constexpr const char* GUID_FORMAT =
69-
"{%08X-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX}";
69+
"{%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX}";
7070
static constexpr int GUID_FORMAT_ARGS = 11;
7171

7272
public:

src/common/unicode_util.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,12 @@
5656
using namespace Firebird;
5757

5858
namespace {
59-
#if defined(WIN_NT)
59+
#if defined(_MSC_VER)
6060
const char* const inTemplate = "icuin%s.dll";
6161
const char* const ucTemplate = "icuuc%s.dll";
62+
#elif defined(MINGW)
63+
const char* const inTemplate = "libicuin%s.dll";
64+
const char* const ucTemplate = "libicuuc%s.dll";
6265
#elif defined(DARWIN)
6366
const char* const inTemplate = "lib/libicui18n.%s.dylib";
6467
const char* const ucTemplate = "lib/libicuuc.%s.dylib";
@@ -1328,7 +1331,7 @@ UnicodeUtil::ConversionICU& UnicodeUtil::getConversionICU()
13281331

13291332
for (int major = 79; major >= 3;)
13301333
{
1331-
#ifdef WIN_NT
1334+
#ifdef _MSC_VER
13321335
int minor = 0;
13331336
#else
13341337
int minor = 9;

src/common/utils_proto.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ namespace fb_utils
127127

128128
#if FB_INT64_COMPARE_FAILED
129129
// avoid compiler bug when comparing minimum INT64
130-
const SINT64 MININT64 = 0x8000000000000000;
131-
if (n1 == MININT64)
132-
return n2 == MININT64 ? 0 : 2;
133-
if (n2 == MININT64)
130+
const SINT64 minInt64 = 0x8000000000000000;
131+
if (n1 == minInt64)
132+
return n2 == minInt64 ? 0 : 2;
133+
if (n2 == minInt64)
134134
return -2;
135135
#endif
136136

src/gpre/languages/fbrmclib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ struct date_fmt
8989
};
9090

9191
#ifdef __WIN32__
92-
#define EXPORT __declspec(dllexport)
92+
#define EXPORT extern __declspec(dllexport)
9393
#define CDECL __cdecl
9494
#else
9595
#define EXPORT

src/include/firebird.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@
6363
#include "../common/common.h"
6464
#endif
6565

66+
#if !defined(MINGW)
6667
#ifdef NULL
6768
#undef NULL
6869
#endif
6970

7071
#define NULL nullptr
72+
#endif
7173

7274
#if defined(WIN_NT)
7375
#define TRUSTED_AUTH

src/iscguard/iscguard.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ THREAD_ENTRY_DECLARE start_and_watch_server(THREAD_ENTRY_PARAM)
726726
}
727727

728728
// wait for process to terminate
729-
DWORD exit_status;
729+
DWORD exit_status = 0;
730730
if (service_flag)
731731
{
732732
while (WaitForSingleObject(procHandle, 500) == WAIT_OBJECT_0)

src/jrd/jrd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8886,7 +8886,7 @@ namespace
88868886
THREAD_ENTRY_DECLARE attachmentShutdownThread(THREAD_ENTRY_PARAM arg)
88878887
{
88888888
#ifdef WIN_NT
8889-
ThreadModuleRef thdRef(attachmentShutdownThread, &engineShutdown);
8889+
ThreadModuleRef thdRef((void*)attachmentShutdownThread, &engineShutdown);
88908890
#endif
88918891

88928892
AttShutParams* params = static_cast<AttShutParams*>(arg);

0 commit comments

Comments
 (0)