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

Commite545281

Browse files
committed
Remove dead code in win32.h.
There's no longer a need for the MSVC-version-specific code stanza thatforcibly redefines errno code symbols, because since commit73838b5 we'reunconditionally redefining them in the stanza before this one anyway.Now it's merely confusing and ugly, so get rid of it; and improve thecomment that explains what's going on here.Although this is just cosmetic, back-patch anyway since I'm intendingto back-patch some less-cosmetic changes in this same hunk of code.
1 parent1421664 commite545281

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed

‎src/include/port/win32.h

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,18 @@ typedef int pid_t;
267267

268268
/*
269269
* Supplement to <errno.h>.
270+
*
271+
* We redefine network-related Berkeley error symbols as the corresponding WSA
272+
* constants. This allows elog.c to recognize them as being in the Winsock
273+
* error code range and pass them off to pgwin32_socket_strerror(), since
274+
* Windows' version of plain strerror() won't cope. Note that this will break
275+
* if these names are used for anything else besides Windows Sockets errors.
276+
* See TranslateSocketError() when changing this list.
270277
*/
271278
#undef EAGAIN
279+
#defineEAGAIN WSAEWOULDBLOCK
272280
#undef EINTR
273281
#defineEINTR WSAEINTR
274-
#defineEAGAIN WSAEWOULDBLOCK
275282
#undef EMSGSIZE
276283
#defineEMSGSIZE WSAEMSGSIZE
277284
#undef EAFNOSUPPORT
@@ -293,26 +300,6 @@ typedef int pid_t;
293300
#undef EOPNOTSUPP
294301
#defineEOPNOTSUPP WSAEOPNOTSUPP
295302

296-
/*
297-
* For Microsoft Visual Studio 2010 and above we intentionally redefine
298-
* the regular Berkeley error constants and set them to the WSA constants.
299-
* Note that this will break if those constants are used for anything else
300-
* than Windows Sockets errors.
301-
*/
302-
#if_MSC_VER >=1600
303-
#pragma warning(disable:4005)
304-
#defineEMSGSIZE WSAEMSGSIZE
305-
#defineEAFNOSUPPORT WSAEAFNOSUPPORT
306-
#defineEWOULDBLOCK WSAEWOULDBLOCK
307-
#defineEPROTONOSUPPORT WSAEPROTONOSUPPORT
308-
#defineECONNRESET WSAECONNRESET
309-
#defineEINPROGRESS WSAEINPROGRESS
310-
#defineENOBUFS WSAENOBUFS
311-
#defineECONNREFUSED WSAECONNREFUSED
312-
#defineEOPNOTSUPP WSAEOPNOTSUPP
313-
#pragma warning(default:4005)
314-
#endif
315-
316303
/*
317304
* Extended locale functions with gratuitous underscore prefixes.
318305
* (These APIs are nevertheless fully documented by Microsoft.)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp