Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita4777f3

Browse files
committed
Remove symbol WIN32_ONLY_COMPILER
This used to mean "Visual C++ except in those parts where Borland C++was supported where it meant one of those". Now that we don't supportBorland C++ anymore, simplify by using _MSC_VER which is the normal wayto detect Visual C++.
1 parent6da56f3 commita4777f3

File tree

19 files changed

+25
-29
lines changed

19 files changed

+25
-29
lines changed

‎src/backend/libpq/auth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ CheckSCRAMAuth(Port *port, char *shadow_pass, char **logdetail)
958958
*/
959959
#ifdefENABLE_GSS
960960

961-
#if defined(WIN32)&& !defined(WIN32_ONLY_COMPILER)
961+
#if defined(WIN32)&& !defined(_MSC_VER)
962962
/*
963963
* MIT Kerberos GSSAPI DLL doesn't properly export the symbols for MingW
964964
* that contain the OIDs required. Redefine here, values copied

‎src/backend/libpq/pqcomm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
#ifdefHAVE_UTIME_H
8686
#include<utime.h>
8787
#endif
88-
#ifdefWIN32_ONLY_COMPILER/* mstcpip.h is missing on mingw */
88+
#ifdef_MSC_VER/* mstcpip.h is missing on mingw */
8989
#include<mstcpip.h>
9090
#endif
9191

‎src/backend/port/win32/mingwcompat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include"postgres.h"
1515

16-
#ifndefWIN32_ONLY_COMPILER
16+
#ifndef_MSC_VER
1717
/*
1818
* MingW defines an extern to this struct, but the actual struct isn't present
1919
* in any library. It's trivial enough that we can safely define it

‎src/common/exec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#definelog_error4(str,param,arg1)(fprintf(stderr, str, param, arg1), fputc('\n', stderr))
3636
#endif
3737

38-
#ifdefWIN32_ONLY_COMPILER
38+
#ifdef_MSC_VER
3939
#definegetcwd(cwd,len) GetCurrentDirectory(len, cwd)
4040
#endif
4141

‎src/include/getaddrinfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#defineEAI_MEMORY(-10)
4141
#defineEAI_SYSTEM(-11)
4242
#else/* WIN32 */
43-
#ifdefWIN32_ONLY_COMPILER
43+
#ifdef_MSC_VER
4444
#ifndefWSA_NOT_ENOUGH_MEMORY
4545
#defineWSA_NOT_ENOUGH_MEMORY(WSAENOBUFS)
4646
#endif

‎src/include/libpq/libpq-be.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@
3838
* that doesn't match the msvc build. It gives a bunch of compiler warnings that we ignore,
3939
* but also defines a symbol that simply does not exist. Undefine it again.
4040
*/
41-
#ifdefWIN32_ONLY_COMPILER
41+
#ifdef_MSC_VER
4242
#undef HAVE_GETADDRINFO
4343
#endif
4444
#endif/* ENABLE_GSS */
4545

4646
#ifdefENABLE_SSPI
4747
#defineSECURITY_WIN32
48-
#if defined(WIN32)&& !defined(WIN32_ONLY_COMPILER)
48+
#if defined(WIN32)&& !defined(_MSC_VER)
4949
#include<ntsecapi.h>
5050
#endif
5151
#include<security.h>

‎src/include/port.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ extern intpgrename(const char *from, const char *to);
231231
externintpgunlink(constchar*path);
232232

233233
/* Include this first so later includes don't see these defines */
234-
#ifdefWIN32_ONLY_COMPILER
234+
#ifdef_MSC_VER
235235
#include<io.h>
236236
#endif
237237

‎src/include/port/atomics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
/* gcc or compatible, including clang and icc */
9797
#elif defined(__GNUC__)|| defined(__INTEL_COMPILER)
9898
#include"port/atomics/generic-gcc.h"
99-
#elif defined(WIN32_ONLY_COMPILER)
99+
#elif defined(_MSC_VER)
100100
#include"port/atomics/generic-msvc.h"
101101
#elif defined(__hpux)&& defined(__ia64)&& !defined(__GNUC__)
102102
#include"port/atomics/generic-acc.h"

‎src/include/port/atomics/arch-x86.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ pg_spin_delay_impl(void)
113113
{
114114
__asm__ __volatile__(" rep; nop\n");
115115
}
116-
#elif defined(WIN32_ONLY_COMPILER)&& defined(__x86_64__)
116+
#elif defined(_MSC_VER)&& defined(__x86_64__)
117117
#definePG_HAVE_SPIN_DELAY
118118
static __forceinlinevoid
119119
pg_spin_delay_impl(void)
120120
{
121121
_mm_pause();
122122
}
123-
#elif defined(WIN32_ONLY_COMPILER)
123+
#elif defined(_MSC_VER)
124124
#definePG_HAVE_SPIN_DELAY
125125
static __forceinlinevoid
126126
pg_spin_delay_impl(void)

‎src/include/port/win32.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
/* src/include/port/win32.h */
22

3-
#if defined(_MSC_VER)
4-
#defineWIN32_ONLY_COMPILER
5-
#endif
6-
73
/*
84
* Make sure _WIN32_WINNT has the minimum required value.
95
* Leave a higher value in place. When building with at least Visual
@@ -43,7 +39,7 @@
4339
* The Mingw64 headers choke if this is already defined - they
4440
* define it themselves.
4541
*/
46-
#if !defined(__MINGW64_VERSION_MAJOR)|| defined(WIN32_ONLY_COMPILER)
42+
#if !defined(__MINGW64_VERSION_MAJOR)|| defined(_MSC_VER)
4743
#define_WINSOCKAPI_
4844
#endif
4945
#include<winsock2.h>
@@ -233,7 +229,7 @@ intsetitimer(int which, const struct itimerval * value, struct itimerval * ov
233229
* with 64-bit offsets.
234230
*/
235231
#definepgoff_t __int64
236-
#ifdefWIN32_ONLY_COMPILER
232+
#ifdef_MSC_VER
237233
#definefseeko(stream,offset,origin) _fseeki64(stream, offset, origin)
238234
#defineftello(stream) _ftelli64(stream)
239235
#else
@@ -256,7 +252,7 @@ typedef int gid_t;
256252
#endif
257253
typedeflongkey_t;
258254

259-
#ifdefWIN32_ONLY_COMPILER
255+
#ifdef_MSC_VER
260256
typedefintpid_t;
261257
#endif
262258

@@ -416,7 +412,7 @@ extern intpgwin32_is_admin(void);
416412
#defineunsetenv(x) pgwin32_unsetenv(x)
417413

418414
/* Things that exist in MingW headers, but need to be added to MSVC */
419-
#ifdefWIN32_ONLY_COMPILER
415+
#ifdef_MSC_VER
420416

421417
#ifndef_WIN64
422418
typedeflongssize_t;
@@ -446,7 +442,7 @@ typedef unsigned short mode_t;
446442
/* Pulled from Makefile.port in mingw */
447443
#defineDLSUFFIX ".dll"
448444

449-
#endif/*WIN32_ONLY_COMPILER */
445+
#endif/*_MSC_VER */
450446

451447
/* These aren't provided by either MingW or MSVC */
452448
#defineS_IRGRP 0

‎src/include/storage/s_lock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ extern slock_t pg_atomic_cas(volatile slock_t *lock, slock_t with,
833833
#endif
834834

835835

836-
#ifdefWIN32_ONLY_COMPILER
836+
#ifdef_MSC_VER
837837
typedefLONGslock_t;
838838

839839
#defineHAS_TEST_AND_SET

‎src/interfaces/ecpg/test/expected/thread-thread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ void *test_thread(void *arg)
152152

153153

154154
/* build up connection name, and connect to database */
155-
#ifndefWIN32_ONLY_COMPILER
155+
#ifndef_MSC_VER
156156
snprintf(l_connection,sizeof(l_connection),"thread_%03ld",threadnum);
157157
#else
158158
_snprintf(l_connection,sizeof(l_connection),"thread_%03ld",threadnum);

‎src/interfaces/ecpg/test/expected/thread-thread_implicit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void *test_thread(void *arg)
153153

154154

155155
/* build up connection name, and connect to database */
156-
#ifndefWIN32_ONLY_COMPILER
156+
#ifndef_MSC_VER
157157
snprintf(l_connection,sizeof(l_connection),"thread_%03ld",threadnum);
158158
#else
159159
_snprintf(l_connection,sizeof(l_connection),"thread_%03ld",threadnum);

‎src/interfaces/ecpg/test/thread/thread.pgc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void *test_thread(void *arg)
103103
EXEC SQL END DECLARE SECTION;
104104

105105
/* build up connection name, and connect to database */
106-
#ifndefWIN32_ONLY_COMPILER
106+
#ifndef_MSC_VER
107107
snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum);
108108
#else
109109
_snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum);

‎src/interfaces/ecpg/test/thread/thread_implicit.pgc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void *test_thread(void *arg)
104104
EXEC SQL END DECLARE SECTION;
105105

106106
/* build up connection name, and connect to database */
107-
#ifndefWIN32_ONLY_COMPILER
107+
#ifndef_MSC_VER
108108
snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum);
109109
#else
110110
_snprintf(l_connection, sizeof(l_connection), "thread_%03ld", threadnum);

‎src/interfaces/libpq/fe-auth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
* GSSAPI authentication system.
5050
*/
5151

52-
#if defined(WIN32)&& !defined(WIN32_ONLY_COMPILER)
52+
#if defined(WIN32)&& !defined(_MSC_VER)
5353
/*
5454
* MIT Kerberos GSSAPI DLL doesn't properly export the symbols for MingW
5555
* that contain the OIDs required. Redefine here, values copied

‎src/interfaces/libpq/fe-connect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#endif
3838
#definenear
3939
#include<shlobj.h>
40-
#ifdefWIN32_ONLY_COMPILER/* mstcpip.h is missing on mingw */
40+
#ifdef_MSC_VER/* mstcpip.h is missing on mingw */
4141
#include<mstcpip.h>
4242
#endif
4343
#else

‎src/interfaces/libpq/libpq-int.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
#ifdefENABLE_SSPI
5555
#defineSECURITY_WIN32
56-
#if defined(WIN32)&& !defined(WIN32_ONLY_COMPILER)
56+
#if defined(WIN32)&& !defined(_MSC_VER)
5757
#include<ntsecapi.h>
5858
#endif
5959
#include<security.h>

‎src/tools/msvc/ecpg_regression.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
<!-- Run ECPG and the Visual C++ compiler on the files. Don't bother with dependency check between the steps-->
5353
<ExecWorkingDirectory="%(Pgc.RelativeDir)"Command="$(OUTDIR)ecpg\ecpg -I ../../include --regression $(ECPGPARAM) -o %(Pgc.Filename).c %(Pgc.Filename).pgc" />
54-
<ExecWorkingDirectorY="%(Pgc.RelativeDir)"Command="cl /nologo %(Pgc.FileName).c /TC /MD$(DEBUGLIB) /DENABLE_THREAD_SAFETY /DWIN32 /DWIN32_ONLY_COMPILER /I. /I..\..\include /I..\..\..\libpq /I..\..\..\..\include /link /defaultlib:$(OUTDIR)libecpg\libecpg.lib /defaultlib:$(OUTDIR)libecpg_compat\libecpg_compat.lib /defaultlib:$(OUTDIR)libpgtypes\libpgtypes.lib" />
54+
<ExecWorkingDirectorY="%(Pgc.RelativeDir)"Command="cl /nologo %(Pgc.FileName).c /TC /MD$(DEBUGLIB) /DENABLE_THREAD_SAFETY /DWIN32 /D_MSC_VER /I. /I..\..\include /I..\..\..\libpq /I..\..\..\..\include /link /defaultlib:$(OUTDIR)libecpg\libecpg.lib /defaultlib:$(OUTDIR)libecpg_compat\libecpg_compat.lib /defaultlib:$(OUTDIR)libpgtypes\libpgtypes.lib" />
5555
</Target>
5656

5757
<!-- Clean up all output files-->

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp