Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9b38a14

Browse files
committed
Rationalized MS ifdefs
1 parent d4ab3cd commit 9b38a14

3 files changed

Lines changed: 10 additions & 18 deletions

File tree

Python/importdl.c

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3838
USE_DL -- Jack's dl for IRIX 4 or GNU dld with emulation for Jack's dl
3939
USE_SHLIB -- SunOS or IRIX 5 (SVR4?) shared libraries
4040
_AIX -- AIX style dynamic linking
41-
NT -- NT style dynamic linking (using DLLs)
42-
WIN16_DL -- Windows 16-bit dynamic linking (using DLLs)
41+
MS_WIN32 -- Windows NT style dynamic linking (using DLLs)
42+
MS_WIN16 -- Windows 16-bit dynamic linking (using DLLs)
4343
_DL_FUNCPTR_DEFINED -- if the typedef dl_funcptr has been defined
4444
USE_MAC_DYNAMIC_LOADING -- Mac CFM shared libraries
4545
SHORT_EXT -- short extension for dynamic module, e.g. ".so"
@@ -76,15 +76,7 @@ typedef void (*dl_funcptr)();
7676
#define dlerror() "error in dynamic linking"
7777
#endif
7878

79-
#ifdef __WIN32__
80-
#define NT
81-
#endif
82-
83-
#ifdef MS_WIN16
84-
#define WIN16_DL
85-
#endif
86-
87-
#if defined(NT) || defined(WIN16_DL)
79+
#ifdef MS_WINDOWS /* i.e. MS_WIN32 or MS_WIN16 */
8880
#define DYNAMIC_LINK
8981
#include <windows.h>
9082
typedef FARPROC dl_funcptr;
@@ -382,7 +374,7 @@ load_dynamic_module(name, pathname, fp)
382374
}
383375
}
384376
#endif /* _AIX */
385-
#ifdef NT
377+
#ifdef MS_WIN32
386378
{
387379
HINSTANCE hDLL;
388380
hDLL = LoadLibrary(pathname);
@@ -424,8 +416,8 @@ load_dynamic_module(name, pathname, fp)
424416
}
425417
p = GetProcAddress(hDLL, funcname);
426418
}
427-
#endif /* NT */
428-
#ifdef WIN16_DL
419+
#endif /* MS_WIN32 */
420+
#ifdef MS_WIN16
429421
{
430422
HINSTANCE hDLL;
431423
hDLL = LoadLibrary(pathname);
@@ -437,7 +429,7 @@ load_dynamic_module(name, pathname, fp)
437429
}
438430
p = GetProcAddress(hDLL, funcname);
439431
}
440-
#endif /* WIN16_DL */
432+
#endif /* MS_WIN16 */
441433
#ifdef USE_DL
442434
p = dl_loadmod(getprogramname(), pathname, funcname);
443435
#endif /* USE_DL */

Python/pythonrun.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4444
#include <signal.h>
4545
#endif
4646

47-
#ifdef NT
47+
#ifdef MS_WIN32
4848
#undef BYTE
4949
#undef arglist
5050
#include "windows.h"
@@ -562,7 +562,7 @@ fatal(msg)
562562
#ifdef macintosh
563563
for (;;);
564564
#endif
565-
#ifdef NT
565+
#ifdef MS_WIN32
566566
OutputDebugString("Fatal Python error:");
567567
OutputDebugString(msg);
568568
OutputDebugString("\n");

Python/sysmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ int sys_checkinterval = 10;
4949

5050
static object *sysdict;
5151

52-
#ifdef NT
52+
#ifdef MS_COREDLL
5353
extern void *PyWin_DLLhModule;
5454
#endif
5555

0 commit comments

Comments
 (0)