Răsfoiți Sursa

general: removed all WIN32, WIN32_VC and friends

Leandro (Cerberus1746) Benedet Garcia 5 ani în urmă
părinte
comite
5f7809469c
87 a modificat fișierele cu 263 adăugiri și 298 ștergeri
  1. 1 1
      cmake/macros/Interrogate.cmake
  2. 3 3
      direct/src/dcparser/dcbase.h
  3. 3 3
      direct/src/showbase/showBase.cxx
  4. 2 2
      dtool/src/dtoolbase/atomicAdjustWin32Impl.cxx
  5. 2 2
      dtool/src/dtoolbase/atomicAdjustWin32Impl.h
  6. 1 1
      dtool/src/dtoolbase/dtoolbase.cxx
  7. 3 15
      dtool/src/dtoolbase/dtoolbase.h
  8. 1 1
      dtool/src/dtoolbase/dtoolbase_cc.h
  9. 5 5
      dtool/src/dtoolbase/memoryHook.cxx
  10. 1 1
      dtool/src/dtoolbase/mutexImpl.h
  11. 2 2
      dtool/src/dtoolbase/mutexWin32Impl.cxx
  12. 2 2
      dtool/src/dtoolbase/mutexWin32Impl.h
  13. 1 1
      dtool/src/dtoolbase/selectThreadImpl.h
  14. 6 6
      dtool/src/dtoolutil/executionEnvironment.cxx
  15. 75 77
      dtool/src/dtoolutil/filename.cxx
  16. 1 1
      dtool/src/dtoolutil/load_dso.cxx
  17. 2 2
      dtool/src/dtoolutil/pfstreamBuf.h
  18. 1 1
      dtool/src/dtoolutil/vector_src.h
  19. 1 1
      dtool/src/interrogatedb/config_interrogatedb.cxx
  20. 4 4
      dtool/src/prc/configPageManager.cxx
  21. 3 3
      dtool/src/prc/notify.cxx
  22. 2 2
      dtool/src/prc/streamWrapper.I
  23. 9 9
      dtool/src/prc/streamWrapper.cxx
  24. 1 1
      dtool/src/prc/streamWrapper.h
  25. 1 1
      dtool/src/test_interrogate/test_interrogate.cxx
  26. 4 9
      makepanda/makepanda.py
  27. 2 2
      panda/src/audio/audioManager.cxx
  28. 1 1
      panda/src/audio/config_audio.h
  29. 1 1
      panda/src/display/graphicsEngine.cxx
  30. 1 1
      panda/src/display/graphicsWindowProc.h
  31. 1 1
      panda/src/display/graphicsWindowProcCallbackData.I
  32. 1 1
      panda/src/display/graphicsWindowProcCallbackData.cxx
  33. 3 3
      panda/src/display/graphicsWindowProcCallbackData.h
  34. 2 2
      panda/src/display/nativeWindowHandle.I
  35. 6 6
      panda/src/display/nativeWindowHandle.cxx
  36. 4 4
      panda/src/display/nativeWindowHandle.h
  37. 6 6
      panda/src/downloader/bioStreamBuf.cxx
  38. 2 2
      panda/src/downloader/httpChannel.cxx
  39. 2 2
      panda/src/downloader/multiplexStreamBuf.cxx
  40. 1 1
      panda/src/egg/eggGroupNode.h
  41. 1 1
      panda/src/egg/eggPrimitive.h
  42. 3 3
      panda/src/express/error_utils.cxx
  43. 4 4
      panda/src/express/memoryUsage.cxx
  44. 1 1
      panda/src/express/memoryUsage.h
  45. 1 1
      panda/src/express/multifile.cxx
  46. 2 2
      panda/src/express/pointerToArray.I
  47. 4 4
      panda/src/express/pointerToArray.h
  48. 3 3
      panda/src/express/trueClock.I
  49. 2 2
      panda/src/express/trueClock.cxx
  50. 1 1
      panda/src/express/trueClock.h
  51. 12 12
      panda/src/express/virtualFileMountSystem.cxx
  52. 3 3
      panda/src/express/virtualFileSystem.cxx
  53. 1 1
      panda/src/glstuff/glmisc_src.h
  54. 1 1
      panda/src/glstuff/glpure.cxx
  55. 1 1
      panda/src/grutil/frameRateMeter.cxx
  56. 1 1
      panda/src/grutil/sceneGraphAnalyzerMeter.cxx
  57. 2 2
      panda/src/nativenet/socket_fdset.h
  58. 2 2
      panda/src/nativenet/time_base.h
  59. 3 3
      panda/src/net/connectionManager.cxx
  60. 1 1
      panda/src/pandabase/pandasymbols.h
  61. 1 1
      panda/src/pgraph/findApproxPath.h
  62. 1 1
      panda/src/pipeline/conditionVarImpl.h
  63. 2 2
      panda/src/pipeline/conditionVarWin32Impl.cxx
  64. 2 2
      panda/src/pipeline/conditionVarWin32Impl.h
  65. 3 3
      panda/src/pipeline/test_delete.cxx
  66. 3 3
      panda/src/pipeline/test_diners.cxx
  67. 2 2
      panda/src/pipeline/threadDummyImpl.I
  68. 1 1
      panda/src/pipeline/threadDummyImpl.cxx
  69. 1 1
      panda/src/pipeline/threadDummyImpl.h
  70. 2 10
      panda/src/pnmimage/pnmimage_base.cxx
  71. 3 3
      panda/src/pnmimagetypes/colrops.c
  72. 0 8
      panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx
  73. 1 1
      panda/src/pstatclient/pStatClientImpl.cxx
  74. 2 2
      panda/src/speedtree/speedTreeNode.cxx
  75. 2 2
      panda/src/tinydisplay/config_tinydisplay.cxx
  76. 1 1
      panda/src/tinydisplay/tinyWinGraphicsPipe.cxx
  77. 1 1
      panda/src/tinydisplay/tinyWinGraphicsPipe.h
  78. 1 1
      panda/src/tinydisplay/tinyWinGraphicsWindow.cxx
  79. 1 1
      panda/src/tinydisplay/tinyWinGraphicsWindow.h
  80. 1 1
      panda/src/tinydisplay/zfeatures.h
  81. 2 2
      pandatool/src/maya/mayaApi.cxx
  82. 2 2
      pandatool/src/mayaprogs/mayaPview.cxx
  83. 4 4
      pandatool/src/mayaprogs/mayaSavePview.cxx
  84. 1 1
      pandatool/src/mayaprogs/mayaSavePview.h
  85. 2 2
      pandatool/src/mayaprogs/mayaToEgg_server.cxx
  86. 1 1
      pandatool/src/mayaprogs/mayapath.cxx
  87. 1 1
      pandatool/src/palettizer/paletteGroups.h

+ 1 - 1
cmake/macros/Interrogate.cmake

@@ -31,7 +31,7 @@ set(INTERROGATE_EXCLUDE_REGEXES
 )
 )
 
 
 if(WIN32)
 if(WIN32)
-  list(APPEND IGATE_FLAGS -D_X86_ -D__STDC__=1 -DWIN32_VC -D "_declspec(param)=" -D "__declspec(param)=" -D_near -D_far -D__near -D__far -D_WIN32 -D__stdcall -DWIN32)
+  list(APPEND IGATE_FLAGS -D_X86_ -D__STDC__=1 -D "_declspec(param)=" -D "__declspec(param)=" -D_near -D_far -D__near -D__far -D_WIN32 -D__stdcall)
 endif()
 endif()
 if(MSVC_VERSION)
 if(MSVC_VERSION)
   list(APPEND IGATE_FLAGS "-D_MSC_VER=${MSVC_VERSION}")
   list(APPEND IGATE_FLAGS "-D_MSC_VER=${MSVC_VERSION}")

+ 3 - 3
direct/src/dcparser/dcbase.h

@@ -36,12 +36,12 @@
 
 
 #else  // WITHIN_PANDA
 #else  // WITHIN_PANDA
 
 
-#ifdef WIN32
+#ifdef _MSC_VER
 /* C4786: 255 char debug symbols */
 /* C4786: 255 char debug symbols */
 #pragma warning (disable : 4786)
 #pragma warning (disable : 4786)
 /* C4503: decorated name length exceeded */
 /* C4503: decorated name length exceeded */
 #pragma warning (disable : 4503)
 #pragma warning (disable : 4503)
-#endif  /* WIN32_VC */
+#endif  /* _MSC_VER */
 
 
 #include <iostream>
 #include <iostream>
 #include <fstream>
 #include <fstream>
@@ -54,7 +54,7 @@
 // These header files are needed to compile dcLexer.cxx, the output from flex.
 // These header files are needed to compile dcLexer.cxx, the output from flex.
 // flex doesn't create a perfectly windows-friendly source file right out of
 // flex doesn't create a perfectly windows-friendly source file right out of
 // the box.
 // the box.
-#ifdef WIN32
+#ifdef _WIN32
 #include <io.h>
 #include <io.h>
 #include <malloc.h>
 #include <malloc.h>
 #else
 #else

+ 3 - 3
direct/src/showbase/showBase.cxx

@@ -27,7 +27,7 @@ extern "C" { void CPSEnableForegroundOperation(ProcessSerialNumber* psn); }
 #include "camera.h"
 #include "camera.h"
 #include "graphicsPipeSelection.h"
 #include "graphicsPipeSelection.h"
 
 
-#ifdef WIN32
+#ifdef _WIN32
 #include <windows.h>  // For SystemParametersInfo()
 #include <windows.h>  // For SystemParametersInfo()
 STICKYKEYS g_StartupStickyKeys = {sizeof(STICKYKEYS), 0};
 STICKYKEYS g_StartupStickyKeys = {sizeof(STICKYKEYS), 0};
 TOGGLEKEYS g_StartupToggleKeys = {sizeof(TOGGLEKEYS), 0};
 TOGGLEKEYS g_StartupToggleKeys = {sizeof(TOGGLEKEYS), 0};
@@ -131,7 +131,7 @@ query_fullscreen_testresult(int xsize, int ysize) {
 
 
 void
 void
 store_accessibility_shortcut_keys() {
 store_accessibility_shortcut_keys() {
-#ifdef WIN32
+#ifdef _WIN32
   SystemParametersInfo(SPI_GETSTICKYKEYS, sizeof(STICKYKEYS), &g_StartupStickyKeys, 0);
   SystemParametersInfo(SPI_GETSTICKYKEYS, sizeof(STICKYKEYS), &g_StartupStickyKeys, 0);
   SystemParametersInfo(SPI_GETTOGGLEKEYS, sizeof(TOGGLEKEYS), &g_StartupToggleKeys, 0);
   SystemParametersInfo(SPI_GETTOGGLEKEYS, sizeof(TOGGLEKEYS), &g_StartupToggleKeys, 0);
   SystemParametersInfo(SPI_GETFILTERKEYS, sizeof(FILTERKEYS), &g_StartupFilterKeys, 0);
   SystemParametersInfo(SPI_GETFILTERKEYS, sizeof(FILTERKEYS), &g_StartupFilterKeys, 0);
@@ -140,7 +140,7 @@ store_accessibility_shortcut_keys() {
 
 
 void
 void
 allow_accessibility_shortcut_keys(bool allowKeys) {
 allow_accessibility_shortcut_keys(bool allowKeys) {
-#ifdef WIN32
+#ifdef _WIN32
   if( allowKeys )
   if( allowKeys )
   {
   {
     // Restore StickyKeysetc to original state and enable Windows key
     // Restore StickyKeysetc to original state and enable Windows key

+ 2 - 2
dtool/src/dtoolbase/atomicAdjustWin32Impl.cxx

@@ -13,8 +13,8 @@
 
 
 #include "selectThreadImpl.h"
 #include "selectThreadImpl.h"
 
 
-#ifdef WIN32_VC
+#ifdef _WIN32
 
 
 #include "atomicAdjustWin32Impl.h"
 #include "atomicAdjustWin32Impl.h"
 
 
-#endif  // WIN32_VC
+#endif  // _WIN32

+ 2 - 2
dtool/src/dtoolbase/atomicAdjustWin32Impl.h

@@ -17,7 +17,7 @@
 #include "dtoolbase.h"
 #include "dtoolbase.h"
 #include "selectThreadImpl.h"
 #include "selectThreadImpl.h"
 
 
-#ifdef WIN32_VC
+#ifdef _WIN32
 
 
 #include "numeric_types.h"
 #include "numeric_types.h"
 
 
@@ -62,6 +62,6 @@ public:
 
 
 #include "atomicAdjustWin32Impl.I"
 #include "atomicAdjustWin32Impl.I"
 
 
-#endif  // WIN32_VC
+#endif  // _WIN32
 
 
 #endif
 #endif

+ 1 - 1
dtool/src/dtoolbase/dtoolbase.cxx

@@ -18,7 +18,7 @@
   #error Buildsystem error: BUILDING_DTOOL_DTOOLBASE not defined
   #error Buildsystem error: BUILDING_DTOOL_DTOOLBASE not defined
 #endif
 #endif
 
 
-#if defined(USE_TAU) && defined(WIN32)
+#if defined(USE_TAU) && defined(_WIN32)
 // Hack around tau's lack of DLL export declarations for Profiler class.
 // Hack around tau's lack of DLL export declarations for Profiler class.
 bool __tau_shutdown = false;
 bool __tau_shutdown = false;
 #endif
 #endif

+ 3 - 15
dtool/src/dtoolbase/dtoolbase.h

@@ -21,19 +21,7 @@
 
 
 #include "dtool_config.h"
 #include "dtool_config.h"
 
 
-/* Make sure WIN32 and WIN32_VC are defined when using MSVC */
-#if defined(_WIN32) || defined(_WIN64)
-#ifndef WIN32
-#define WIN32
-#endif
 #ifdef _MSC_VER
 #ifdef _MSC_VER
-#ifndef WIN32_VC
-#define WIN32_VC
-#endif
-#endif
-#endif
-
-#ifdef WIN32_VC
 /* These warning pragmas must appear before anything else for VC++ to
 /* These warning pragmas must appear before anything else for VC++ to
    respect them.  Sheesh. */
    respect them.  Sheesh. */
 
 
@@ -58,11 +46,11 @@
 #pragma warning (disable : 4267)
 #pragma warning (disable : 4267)
 /* C4577: 'noexcept' used with no exception handling mode specified */
 /* C4577: 'noexcept' used with no exception handling mode specified */
 #pragma warning (disable : 4577)
 #pragma warning (disable : 4577)
-#endif  /* WIN32_VC */
+#endif  /* _MSC_VER */
 
 
 /* Windows likes to define min() and max() macros, which will conflict with
 /* Windows likes to define min() and max() macros, which will conflict with
    std::min() and std::max() respectively, unless we do this: */
    std::min() and std::max() respectively, unless we do this: */
-#ifdef WIN32
+#ifdef _WIN32
 #ifndef NOMINMAX
 #ifndef NOMINMAX
 #define NOMINMAX
 #define NOMINMAX
 #endif
 #endif
@@ -485,7 +473,7 @@ typedef struct _object PyObject;
 #endif
 #endif
 
 
 /* These symbols are used in dtoolsymbols.h and pandasymbols.h. */
 /* These symbols are used in dtoolsymbols.h and pandasymbols.h. */
-#if defined(WIN32_VC) && !defined(CPPPARSER) && !defined(LINK_ALL_STATIC)
+#if defined(_WIN32) && !defined(CPPPARSER) && !defined(LINK_ALL_STATIC)
 #define EXPORT_CLASS __declspec(dllexport)
 #define EXPORT_CLASS __declspec(dllexport)
 #define IMPORT_CLASS __declspec(dllimport)
 #define IMPORT_CLASS __declspec(dllimport)
 #elif __GNUC__ >= 4 && !defined(CPPPARSER) && !defined(LINK_ALL_STATIC)
 #elif __GNUC__ >= 4 && !defined(CPPPARSER) && !defined(LINK_ALL_STATIC)

+ 1 - 1
dtool/src/dtoolbase/dtoolbase_cc.h

@@ -251,7 +251,7 @@ INLINE void thread_consider_yield() {
 
 
 #endif  // HAVE_THREADS && SIMPLE_THREADS
 #endif  // HAVE_THREADS && SIMPLE_THREADS
 
 
-#if defined(USE_TAU) && defined(WIN32)
+#if defined(USE_TAU) && defined(_WIN32)
 // Hack around tau's lack of DLL export declarations for Profiler class.
 // Hack around tau's lack of DLL export declarations for Profiler class.
 extern EXPCL_DTOOL_DTOOLBASE bool __tau_shutdown;
 extern EXPCL_DTOOL_DTOOLBASE bool __tau_shutdown;
 class EXPCL_DTOOL_DTOOLBASE TauProfile {
 class EXPCL_DTOOL_DTOOLBASE TauProfile {

+ 5 - 5
dtool/src/dtoolbase/memoryHook.cxx

@@ -16,7 +16,7 @@
 #include <stdlib.h>
 #include <stdlib.h>
 #include "typeRegistry.h"
 #include "typeRegistry.h"
 
 
-#ifdef WIN32
+#ifdef _WIN32
 
 
 // Windows case.
 // Windows case.
 #ifndef WIN32_LEAN_AND_MEAN
 #ifndef WIN32_LEAN_AND_MEAN
@@ -191,7 +191,7 @@ ptr_to_alloc(void *ptr, size_t &size) {
  */
  */
 MemoryHook::
 MemoryHook::
 MemoryHook() {
 MemoryHook() {
-#ifdef WIN32
+#ifdef _WIN32
 
 
   // Windows case.
   // Windows case.
   SYSTEM_INFO sysinfo;
   SYSTEM_INFO sysinfo;
@@ -487,7 +487,7 @@ heap_trim(size_t pad) {
   _lock.unlock();
   _lock.unlock();
 #endif
 #endif
 
 
-#ifdef WIN32
+#ifdef _WIN32
   // Also, on Windows we have _heapmin().
   // Also, on Windows we have _heapmin().
   if (_heapmin() == 0) {
   if (_heapmin() == 0) {
     trimmed = true;
     trimmed = true;
@@ -516,7 +516,7 @@ mmap_alloc(size_t size, bool allow_exec) {
   _total_mmap_size += size;
   _total_mmap_size += size;
 #endif
 #endif
 
 
-#ifdef WIN32
+#ifdef _WIN32
 
 
   // Windows case.
   // Windows case.
   void *ptr = VirtualAlloc(nullptr, size, MEM_COMMIT | MEM_RESERVE,
   void *ptr = VirtualAlloc(nullptr, size, MEM_COMMIT | MEM_RESERVE,
@@ -571,7 +571,7 @@ mmap_free(void *ptr, size_t size) {
   _total_mmap_size -= size;
   _total_mmap_size -= size;
 #endif
 #endif
 
 
-#ifdef WIN32
+#ifdef _WIN32
   VirtualFree(ptr, 0, MEM_RELEASE);
   VirtualFree(ptr, 0, MEM_RELEASE);
 #else
 #else
   munmap(ptr, size);
   munmap(ptr, size);

+ 1 - 1
dtool/src/dtoolbase/mutexImpl.h

@@ -49,7 +49,7 @@ typedef ReMutexPosixImpl ReMutexImpl;
 // Also define what a true OS-provided lock will be, even if we don't have
 // Also define what a true OS-provided lock will be, even if we don't have
 // threading enabled in the build.  Sometimes we need to interface with an
 // threading enabled in the build.  Sometimes we need to interface with an
 // external program or something that wants real locks.
 // external program or something that wants real locks.
-#if defined(WIN32_VC)
+#if defined(_WIN32)
 #include "mutexWin32Impl.h"
 #include "mutexWin32Impl.h"
 typedef MutexWin32Impl TrueMutexImpl;
 typedef MutexWin32Impl TrueMutexImpl;
 
 

+ 2 - 2
dtool/src/dtoolbase/mutexWin32Impl.cxx

@@ -13,7 +13,7 @@
 
 
 #include "selectThreadImpl.h"
 #include "selectThreadImpl.h"
 
 
-#ifdef WIN32_VC
+#if defined(_WIN32) && !defined(CPPPARSER)
 
 
 #include "mutexWin32Impl.h"
 #include "mutexWin32Impl.h"
 
 
@@ -28,4 +28,4 @@ ReMutexWin32Impl() {
   InitializeCriticalSectionAndSpinCount(&_lock, spin_count);
   InitializeCriticalSectionAndSpinCount(&_lock, spin_count);
 }
 }
 
 
-#endif  // WIN32_VC
+#endif  // _WIN32

+ 2 - 2
dtool/src/dtoolbase/mutexWin32Impl.h

@@ -17,7 +17,7 @@
 #include "dtoolbase.h"
 #include "dtoolbase.h"
 #include "selectThreadImpl.h"
 #include "selectThreadImpl.h"
 
 
-#ifdef WIN32_VC
+#ifdef _WIN32
 #ifndef WIN32_LEAN_AND_MEAN
 #ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN 1
 #define WIN32_LEAN_AND_MEAN 1
 #endif
 #endif
@@ -68,6 +68,6 @@ private:
 
 
 #include "mutexWin32Impl.I"
 #include "mutexWin32Impl.I"
 
 
-#endif  // WIN32_VC
+#endif  // _WIN32
 
 
 #endif
 #endif

+ 1 - 1
dtool/src/dtoolbase/selectThreadImpl.h

@@ -47,7 +47,7 @@
 #undef TVOLATILE
 #undef TVOLATILE
 #define TVOLATILE
 #define TVOLATILE
 
 
-#elif defined(WIN32_VC)
+#elif defined(_WIN32)
 
 
 // In Windows, use the native threading library.
 // In Windows, use the native threading library.
 #define THREAD_WIN32_IMPL 1
 #define THREAD_WIN32_IMPL 1

+ 6 - 6
dtool/src/dtoolutil/executionEnvironment.cxx

@@ -101,7 +101,7 @@ static const char *const libp3dtool_filenames[] = {
   // libp3dtool dynamic library - no guesswork needed.
   // libp3dtool dynamic library - no guesswork needed.
   LIBP3DTOOL_FILENAMES
   LIBP3DTOOL_FILENAMES
 
 
-#elif defined(WIN32_VC)
+#elif defined(_WIN32)
 
 
 #ifdef _DEBUG
 #ifdef _DEBUG
   "libp3dtool_d.dll",
   "libp3dtool_d.dll",
@@ -223,7 +223,7 @@ get_cwd() {
   Filename cwd = Filename::from_os_specific_w(buffer);
   Filename cwd = Filename::from_os_specific_w(buffer);
   cwd.make_true_case();
   cwd.make_true_case();
   return cwd;
   return cwd;
-#else  // WIN32_VC
+#else  // _WIN32
   // getcwd() requires us to allocate a dynamic buffer and grow it on demand.
   // getcwd() requires us to allocate a dynamic buffer and grow it on demand.
   static size_t bufsize = 1024;
   static size_t bufsize = 1024;
   static char *buffer = nullptr;
   static char *buffer = nullptr;
@@ -246,7 +246,7 @@ get_cwd() {
   Filename cwd = Filename::from_os_specific(buffer);
   Filename cwd = Filename::from_os_specific(buffer);
   cwd.make_true_case();
   cwd.make_true_case();
   return cwd;
   return cwd;
-#endif  // WIN32_VC
+#endif  // _WIN32
 }
 }
 
 
 /**
 /**
@@ -585,7 +585,7 @@ read_args() {
   // the p3dtool library.
   // the p3dtool library.
 
 
 #ifndef LINK_ALL_STATIC
 #ifndef LINK_ALL_STATIC
-#if defined(WIN32_VC)
+#if defined(_WIN32)
   for (const char *filename : libp3dtool_filenames) {
   for (const char *filename : libp3dtool_filenames) {
     if (!_dtool_name.empty()) break;
     if (!_dtool_name.empty()) break;
 
 
@@ -704,7 +704,7 @@ read_args() {
   // Now, we need to fill in _binary_name.  This contains the full path to the
   // Now, we need to fill in _binary_name.  This contains the full path to the
   // currently running executable.
   // currently running executable.
 
 
-#ifdef WIN32_VC
+#ifdef _WIN32
   if (_binary_name.empty()) {
   if (_binary_name.empty()) {
     static const DWORD buffer_size = 1024;
     static const DWORD buffer_size = 1024;
     wchar_t buffer[buffer_size];
     wchar_t buffer[buffer_size];
@@ -766,7 +766,7 @@ read_args() {
   // Next we need to fill in _args, which is a vector containing the command-
   // Next we need to fill in _args, which is a vector containing the command-
   // line arguments that the executable was invoked with.
   // line arguments that the executable was invoked with.
 
 
-#if defined(WIN32_VC)
+#if defined(_WIN32)
 
 
   // We cannot rely on __argv when Python is linked in Unicode mode.  Instead,
   // We cannot rely on __argv when Python is linked in Unicode mode.  Instead,
   // let's use GetCommandLine.
   // let's use GetCommandLine.

+ 75 - 77
dtool/src/dtoolutil/filename.cxx

@@ -70,15 +70,13 @@ TypeHandle Filename::_type_handle;
 string Filename::_internal_data_dir;
 string Filename::_internal_data_dir;
 #endif
 #endif
 
 
-#ifdef WIN32
+#ifdef _WIN32
 /* begin Win32-specific code */
 /* begin Win32-specific code */
 
 
-#ifdef WIN32_VC
 #include <direct.h>
 #include <direct.h>
 #include <windows.h>
 #include <windows.h>
 #include <shlobj.h>
 #include <shlobj.h>
 #include <io.h>
 #include <io.h>
-#endif
 
 
 // The MSVC 6.0 Win32 SDK lacks the following definitions, so we define them
 // The MSVC 6.0 Win32 SDK lacks the following definitions, so we define them
 // here for compatibility.
 // here for compatibility.
@@ -289,7 +287,7 @@ convert_executable_pathname(const string &unix_style_pathname) {
 
 
   return convert_pathname(unix_style_pathname);
   return convert_pathname(unix_style_pathname);
 }
 }
-#endif //WIN32
+#endif // _WIN32
 
 
 /**
 /**
  * This constructor composes the filename out of a directory part and a
  * This constructor composes the filename out of a directory part and a
@@ -326,7 +324,7 @@ Filename(const Filename &dirname, const Filename &basename) {
  */
  */
 Filename Filename::
 Filename Filename::
 from_os_specific(const string &os_specific, Filename::Type type) {
 from_os_specific(const string &os_specific, Filename::Type type) {
-#ifdef WIN32
+#ifdef _WIN32
   string result = back_to_front_slash(os_specific);
   string result = back_to_front_slash(os_specific);
   const string &panda_root = get_panda_root();
   const string &panda_root = get_panda_root();
 
 
@@ -378,12 +376,12 @@ from_os_specific(const string &os_specific, Filename::Type type) {
   Filename filename(result);
   Filename filename(result);
   filename.set_type(type);
   filename.set_type(type);
   return filename;
   return filename;
-#else  // WIN32
+#else  // _WIN32
   // Generic Unix-style filenames--no conversion necessary.
   // Generic Unix-style filenames--no conversion necessary.
   Filename filename(os_specific);
   Filename filename(os_specific);
   filename.set_type(type);
   filename.set_type(type);
   return filename;
   return filename;
-#endif  // WIN32
+#endif  // _WIN32
 }
 }
 
 
 /**
 /**
@@ -487,7 +485,7 @@ get_home_directory() {
     }
     }
 
 
     if (home_directory.empty()) {
     if (home_directory.empty()) {
-#ifdef WIN32
+#ifdef _WIN32
       wchar_t buffer[MAX_PATH];
       wchar_t buffer[MAX_PATH];
 
 
       // On Windows, fall back to the "My Documents" folder.
       // On Windows, fall back to the "My Documents" folder.
@@ -513,7 +511,7 @@ get_home_directory() {
 #else
 #else
       // Posix case: check etcpasswd?
       // Posix case: check etcpasswd?
 
 
-#endif  // WIN32
+#endif  // _WIN32
     }
     }
 
 
     if (home_directory.empty()) {
     if (home_directory.empty()) {
@@ -540,7 +538,7 @@ get_temp_directory() {
   if (AtomicAdjust::get_ptr(_temp_directory) == nullptr) {
   if (AtomicAdjust::get_ptr(_temp_directory) == nullptr) {
     Filename temp_directory;
     Filename temp_directory;
 
 
-#ifdef WIN32
+#ifdef _WIN32
     static const size_t buffer_size = 4096;
     static const size_t buffer_size = 4096;
     wchar_t buffer[buffer_size];
     wchar_t buffer[buffer_size];
     if (GetTempPathW(buffer_size, buffer) != 0) {
     if (GetTempPathW(buffer_size, buffer) != 0) {
@@ -562,7 +560,7 @@ get_temp_directory() {
 #else
 #else
     // Posix case.
     // Posix case.
     temp_directory = "/tmp";
     temp_directory = "/tmp";
-#endif  // WIN32
+#endif  // _WIN32
 
 
     if (temp_directory.empty()) {
     if (temp_directory.empty()) {
       // Fallback case.
       // Fallback case.
@@ -590,7 +588,7 @@ get_user_appdata_directory() {
   if (AtomicAdjust::get_ptr(_user_appdata_directory) == nullptr) {
   if (AtomicAdjust::get_ptr(_user_appdata_directory) == nullptr) {
     Filename user_appdata_directory;
     Filename user_appdata_directory;
 
 
-#ifdef WIN32
+#ifdef _WIN32
     wchar_t buffer[MAX_PATH];
     wchar_t buffer[MAX_PATH];
 
 
     if (SHGetSpecialFolderPathW(nullptr, buffer, CSIDL_LOCAL_APPDATA, true)) {
     if (SHGetSpecialFolderPathW(nullptr, buffer, CSIDL_LOCAL_APPDATA, true)) {
@@ -619,7 +617,7 @@ get_user_appdata_directory() {
       user_appdata_directory = Filename(get_home_directory(), ".local/share");
       user_appdata_directory = Filename(get_home_directory(), ".local/share");
     }
     }
 
 
-#endif  // WIN32
+#endif  // _WIN32
 
 
     if (user_appdata_directory.empty()) {
     if (user_appdata_directory.empty()) {
       // Fallback case.
       // Fallback case.
@@ -646,7 +644,7 @@ get_common_appdata_directory() {
   if (AtomicAdjust::get_ptr(_common_appdata_directory) == nullptr) {
   if (AtomicAdjust::get_ptr(_common_appdata_directory) == nullptr) {
     Filename common_appdata_directory;
     Filename common_appdata_directory;
 
 
-#ifdef WIN32
+#ifdef _WIN32
     wchar_t buffer[MAX_PATH];
     wchar_t buffer[MAX_PATH];
 
 
     if (SHGetSpecialFolderPathW(nullptr, buffer, CSIDL_COMMON_APPDATA, true)) {
     if (SHGetSpecialFolderPathW(nullptr, buffer, CSIDL_COMMON_APPDATA, true)) {
@@ -669,7 +667,7 @@ get_common_appdata_directory() {
     common_appdata_directory = "/usr/local/share";
     common_appdata_directory = "/usr/local/share";
 #else
 #else
     common_appdata_directory = "/usr/share";
     common_appdata_directory = "/usr/share";
-#endif  // WIN32
+#endif  // _WIN32
 
 
     if (common_appdata_directory.empty()) {
     if (common_appdata_directory.empty()) {
       // Fallback case.
       // Fallback case.
@@ -1019,7 +1017,7 @@ make_canonical() {
     return true;
     return true;
   }
   }
 
 
-#ifndef WIN32
+#ifndef _WIN32
   // Use realpath in order to resolve symlinks properly
   // Use realpath in order to resolve symlinks properly
   char newpath [PATH_MAX + 1];
   char newpath [PATH_MAX + 1];
   if (realpath(c_str(), newpath) != nullptr) {
   if (realpath(c_str(), newpath) != nullptr) {
@@ -1057,7 +1055,7 @@ make_true_case() {
     return true;
     return true;
   }
   }
 
 
-#ifdef WIN32
+#ifdef _WIN32
   wstring os_specific = to_os_specific_w();
   wstring os_specific = to_os_specific_w();
 
 
   // First, we have to convert it to its short name, then back to its long
   // First, we have to convert it to its short name, then back to its long
@@ -1105,9 +1103,9 @@ make_true_case() {
   (*this) = true_case;
   (*this) = true_case;
   return true;
   return true;
 
 
-#else  // WIN32
+#else  // _WIN32
   return true;
   return true;
-#endif  // WIN32
+#endif  // _WIN32
 }
 }
 
 
 /**
 /**
@@ -1142,7 +1140,7 @@ to_os_specific() const {
   }
   }
 #endif
 #endif
 
 
-#ifdef WIN32
+#ifdef _WIN32
   switch (get_type()) {
   switch (get_type()) {
   case T_dso:
   case T_dso:
     return convert_dso_pathname(standard.get_fullpath());
     return convert_dso_pathname(standard.get_fullpath());
@@ -1151,9 +1149,9 @@ to_os_specific() const {
   default:
   default:
     return convert_pathname(standard.get_fullpath());
     return convert_pathname(standard.get_fullpath());
   }
   }
-#else // WIN32
+#else // _WIN32
   return standard.c_str();
   return standard.c_str();
-#endif // WIN32
+#endif // _WIN32
 }
 }
 
 
 /**
 /**
@@ -1182,11 +1180,11 @@ string Filename::
 to_os_generic() const {
 to_os_generic() const {
   assert(!get_pattern());
   assert(!get_pattern());
 
 
-#ifdef WIN32
+#ifdef _WIN32
   return back_to_front_slash(to_os_specific());
   return back_to_front_slash(to_os_specific());
-#else // WIN32
+#else // _WIN32
   return to_os_specific();
   return to_os_specific();
-#endif // WIN32
+#endif // _WIN32
 }
 }
 
 
 /**
 /**
@@ -1202,7 +1200,7 @@ string Filename::
 to_os_short_name() const {
 to_os_short_name() const {
   assert(!get_pattern());
   assert(!get_pattern());
 
 
-#ifdef WIN32
+#ifdef _WIN32
   wstring os_specific = to_os_specific_w();
   wstring os_specific = to_os_specific_w();
 
 
   wchar_t short_name[MAX_PATH + 1];
   wchar_t short_name[MAX_PATH + 1];
@@ -1222,9 +1220,9 @@ to_os_short_name() const {
   encoder.set_wtext(short_name);
   encoder.set_wtext(short_name);
   return encoder.get_text();
   return encoder.get_text();
 
 
-#else // WIN32
+#else // _WIN32
   return to_os_specific();
   return to_os_specific();
-#endif // WIN32
+#endif // _WIN32
 }
 }
 
 
 /**
 /**
@@ -1236,7 +1234,7 @@ string Filename::
 to_os_long_name() const {
 to_os_long_name() const {
   assert(!get_pattern());
   assert(!get_pattern());
 
 
-#ifdef WIN32
+#ifdef _WIN32
   wstring os_specific = to_os_specific_w();
   wstring os_specific = to_os_specific_w();
 
 
   wchar_t long_name[MAX_PATH + 1];
   wchar_t long_name[MAX_PATH + 1];
@@ -1253,9 +1251,9 @@ to_os_long_name() const {
   encoder.set_wtext(long_name);
   encoder.set_wtext(long_name);
   return encoder.get_text();
   return encoder.get_text();
 
 
-#else // WIN32
+#else // _WIN32
   return to_os_specific();
   return to_os_specific();
-#endif // WIN32
+#endif // _WIN32
 }
 }
 
 
 /**
 /**
@@ -1265,7 +1263,7 @@ to_os_long_name() const {
  */
  */
 bool Filename::
 bool Filename::
 exists() const {
 exists() const {
-#ifdef WIN32_VC
+#ifdef _WIN32
   wstring os_specific = get_filename_index(0).to_os_specific_w();
   wstring os_specific = get_filename_index(0).to_os_specific_w();
 
 
   bool exists = false;
   bool exists = false;
@@ -1275,7 +1273,7 @@ exists() const {
     exists = true;
     exists = true;
   }
   }
 
 
-#else  // WIN32_VC
+#else  // _WIN32
   string os_specific = get_filename_index(0).to_os_specific();
   string os_specific = get_filename_index(0).to_os_specific();
 
 
   struct stat this_buf;
   struct stat this_buf;
@@ -1295,7 +1293,7 @@ exists() const {
  */
  */
 bool Filename::
 bool Filename::
 is_regular_file() const {
 is_regular_file() const {
-#ifdef WIN32_VC
+#ifdef _WIN32
   wstring os_specific = get_filename_index(0).to_os_specific_w();
   wstring os_specific = get_filename_index(0).to_os_specific_w();
 
 
   bool isreg = false;
   bool isreg = false;
@@ -1305,7 +1303,7 @@ is_regular_file() const {
     isreg = ((results & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_DEVICE)) == 0);
     isreg = ((results & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_DEVICE)) == 0);
   }
   }
 
 
-#else  // WIN32_VC
+#else  // _WIN32
   string os_specific = get_filename_index(0).to_os_specific();
   string os_specific = get_filename_index(0).to_os_specific();
 
 
   struct stat this_buf;
   struct stat this_buf;
@@ -1327,7 +1325,7 @@ bool Filename::
 is_writable() const {
 is_writable() const {
   bool writable = false;
   bool writable = false;
 
 
-#ifdef WIN32_VC
+#ifdef _WIN32
   wstring os_specific = get_filename_index(0).to_os_specific_w();
   wstring os_specific = get_filename_index(0).to_os_specific_w();
 
 
   DWORD results = GetFileAttributesW(os_specific.c_str());
   DWORD results = GetFileAttributesW(os_specific.c_str());
@@ -1340,7 +1338,7 @@ is_writable() const {
       writable = true;
       writable = true;
     }
     }
   }
   }
-#else  // WIN32_VC
+#else  // _WIN32
   string os_specific = get_filename_index(0).to_os_specific();
   string os_specific = get_filename_index(0).to_os_specific();
 
 
   if (access(os_specific.c_str(), W_OK) == 0) {
   if (access(os_specific.c_str(), W_OK) == 0) {
@@ -1357,7 +1355,7 @@ is_writable() const {
  */
  */
 bool Filename::
 bool Filename::
 is_directory() const {
 is_directory() const {
-#ifdef WIN32_VC
+#ifdef _WIN32
   wstring os_specific = get_filename_index(0).to_os_specific_w();
   wstring os_specific = get_filename_index(0).to_os_specific_w();
 
 
   bool isdir = false;
   bool isdir = false;
@@ -1366,7 +1364,7 @@ is_directory() const {
   if (results != -1) {
   if (results != -1) {
     isdir = (results & FILE_ATTRIBUTE_DIRECTORY) != 0;
     isdir = (results & FILE_ATTRIBUTE_DIRECTORY) != 0;
   }
   }
-#else  // WIN32_VC
+#else  // _WIN32
   string os_specific = get_filename_index(0).to_os_specific();
   string os_specific = get_filename_index(0).to_os_specific();
 
 
   struct stat this_buf;
   struct stat this_buf;
@@ -1385,7 +1383,7 @@ is_directory() const {
  */
  */
 bool Filename::
 bool Filename::
 is_executable() const {
 is_executable() const {
-#ifdef WIN32_VC
+#ifdef _WIN32
   // no access() in windows, but to our advantage executables can only end in
   // no access() in windows, but to our advantage executables can only end in
   // .exe or .com
   // .exe or .com
   string extension = get_extension();
   string extension = get_extension();
@@ -1393,12 +1391,12 @@ is_executable() const {
     return exists();
     return exists();
   }
   }
 
 
-#else /* WIN32_VC */
+#else // _WIN32
   string os_specific = get_filename_index(0).to_os_specific();
   string os_specific = get_filename_index(0).to_os_specific();
   if (access(os_specific.c_str(), X_OK) == 0) {
   if (access(os_specific.c_str(), X_OK) == 0) {
     return true;
     return true;
   }
   }
-#endif /* WIN32_VC */
+#endif // _WIN32
 
 
   return false;
   return false;
 }
 }
@@ -1417,7 +1415,7 @@ int Filename::
 compare_timestamps(const Filename &other,
 compare_timestamps(const Filename &other,
                    bool this_missing_is_old,
                    bool this_missing_is_old,
                    bool other_missing_is_old) const {
                    bool other_missing_is_old) const {
-#ifdef WIN32_VC
+#ifdef _WIN32
   wstring os_specific = get_filename_index(0).to_os_specific_w();
   wstring os_specific = get_filename_index(0).to_os_specific_w();
   wstring other_os_specific = other.get_filename_index(0).to_os_specific_w();
   wstring other_os_specific = other.get_filename_index(0).to_os_specific_w();
 
 
@@ -1434,7 +1432,7 @@ compare_timestamps(const Filename &other,
   if (_wstat(other_os_specific.c_str(), &other_buf) == 0) {
   if (_wstat(other_os_specific.c_str(), &other_buf) == 0) {
     other_exists = true;
     other_exists = true;
   }
   }
-#else  // WIN32_VC
+#else  // _WIN32
   string os_specific = get_filename_index(0).to_os_specific();
   string os_specific = get_filename_index(0).to_os_specific();
   string other_os_specific = other.get_filename_index(0).to_os_specific();
   string other_os_specific = other.get_filename_index(0).to_os_specific();
 
 
@@ -1495,7 +1493,7 @@ compare_timestamps(const Filename &other,
  */
  */
 time_t Filename::
 time_t Filename::
 get_timestamp() const {
 get_timestamp() const {
-#ifdef WIN32_VC
+#ifdef _WIN32
   wstring os_specific = get_filename_index(0).to_os_specific_w();
   wstring os_specific = get_filename_index(0).to_os_specific_w();
 
 
   struct _stat this_buf;
   struct _stat this_buf;
@@ -1503,7 +1501,7 @@ get_timestamp() const {
   if (_wstat(os_specific.c_str(), &this_buf) == 0) {
   if (_wstat(os_specific.c_str(), &this_buf) == 0) {
     return this_buf.st_mtime;
     return this_buf.st_mtime;
   }
   }
-#else  // WIN32_VC
+#else  // _WIN32
   string os_specific = get_filename_index(0).to_os_specific();
   string os_specific = get_filename_index(0).to_os_specific();
 
 
   struct stat this_buf;
   struct stat this_buf;
@@ -1523,7 +1521,7 @@ get_timestamp() const {
  */
  */
 time_t Filename::
 time_t Filename::
 get_access_timestamp() const {
 get_access_timestamp() const {
-#ifdef WIN32_VC
+#ifdef _WIN32
   wstring os_specific = get_filename_index(0).to_os_specific_w();
   wstring os_specific = get_filename_index(0).to_os_specific_w();
 
 
   struct _stat this_buf;
   struct _stat this_buf;
@@ -1531,7 +1529,7 @@ get_access_timestamp() const {
   if (_wstat(os_specific.c_str(), &this_buf) == 0) {
   if (_wstat(os_specific.c_str(), &this_buf) == 0) {
     return this_buf.st_atime;
     return this_buf.st_atime;
   }
   }
-#else  // WIN32_VC
+#else  // _WIN32
   string os_specific = get_filename_index(0).to_os_specific();
   string os_specific = get_filename_index(0).to_os_specific();
 
 
   struct stat this_buf;
   struct stat this_buf;
@@ -1549,7 +1547,7 @@ get_access_timestamp() const {
  */
  */
 std::streamsize Filename::
 std::streamsize Filename::
 get_file_size() const {
 get_file_size() const {
-#ifdef WIN32_VC
+#ifdef _WIN32
   wstring os_specific = get_filename_index(0).to_os_specific_w();
   wstring os_specific = get_filename_index(0).to_os_specific_w();
 
 
   struct _stat64 this_buf;
   struct _stat64 this_buf;
@@ -1559,7 +1557,7 @@ get_file_size() const {
   if (_wstati64(os_specific.c_str(), &this_buf) == 0) {
   if (_wstati64(os_specific.c_str(), &this_buf) == 0) {
     return this_buf.st_size;
     return this_buf.st_size;
   }
   }
-#else  // WIN32_VC
+#else  // _WIN32
   string os_specific = get_filename_index(0).to_os_specific();
   string os_specific = get_filename_index(0).to_os_specific();
 
 
   struct stat this_buf;
   struct stat this_buf;
@@ -1718,7 +1716,7 @@ bool Filename::
 scan_directory(vector_string &contents) const {
 scan_directory(vector_string &contents) const {
   assert(!get_pattern());
   assert(!get_pattern());
 
 
-#if defined(WIN32_VC)
+#if defined(_WIN32)
   // Use Windows' FindFirstFile()  FindNextFile() to walk through the list of
   // Use Windows' FindFirstFile()  FindNextFile() to walk through the list of
   // files in a directory.
   // files in a directory.
   size_t orig_size = contents.size();
   size_t orig_size = contents.size();
@@ -1874,13 +1872,13 @@ open_read(std::ifstream &stream) const {
 #endif
 #endif
 
 
   stream.clear();
   stream.clear();
-#ifdef WIN32_VC
+#ifdef _WIN32
   wstring os_specific = to_os_specific_w();
   wstring os_specific = to_os_specific_w();
   stream.open(os_specific.c_str(), open_mode);
   stream.open(os_specific.c_str(), open_mode);
 #else
 #else
   string os_specific = to_os_specific();
   string os_specific = to_os_specific();
   stream.open(os_specific.c_str(), open_mode);
   stream.open(os_specific.c_str(), open_mode);
-#endif  // WIN32_VC
+#endif  // _WIN32
 
 
   return (!stream.fail());
   return (!stream.fail());
 }
 }
@@ -1924,11 +1922,11 @@ open_write(std::ofstream &stream, bool truncate) const {
 #endif
 #endif
 
 
   stream.clear();
   stream.clear();
-#ifdef WIN32_VC
+#ifdef _WIN32
   wstring os_specific = to_os_specific_w();
   wstring os_specific = to_os_specific_w();
 #else
 #else
   string os_specific = to_os_specific();
   string os_specific = to_os_specific();
-#endif  // WIN32_VC
+#endif  // _WIN32
   stream.open(os_specific.c_str(), open_mode);
   stream.open(os_specific.c_str(), open_mode);
 
 
   return (!stream.fail());
   return (!stream.fail());
@@ -1956,11 +1954,11 @@ open_append(std::ofstream &stream) const {
 #endif
 #endif
 
 
   stream.clear();
   stream.clear();
-#ifdef WIN32_VC
+#ifdef _WIN32
   wstring os_specific = to_os_specific_w();
   wstring os_specific = to_os_specific_w();
 #else
 #else
   string os_specific = to_os_specific();
   string os_specific = to_os_specific();
-#endif  // WIN32_VC
+#endif  // _WIN32
   stream.open(os_specific.c_str(), open_mode);
   stream.open(os_specific.c_str(), open_mode);
 
 
   return (!stream.fail());
   return (!stream.fail());
@@ -1998,11 +1996,11 @@ open_read_write(std::fstream &stream, bool truncate) const {
 #endif
 #endif
 
 
   stream.clear();
   stream.clear();
-#ifdef WIN32_VC
+#ifdef _WIN32
   wstring os_specific = to_os_specific_w();
   wstring os_specific = to_os_specific_w();
 #else
 #else
   string os_specific = to_os_specific();
   string os_specific = to_os_specific();
-#endif  // WIN32_VC
+#endif  // _WIN32
   stream.open(os_specific.c_str(), open_mode);
   stream.open(os_specific.c_str(), open_mode);
 
 
   return (!stream.fail());
   return (!stream.fail());
@@ -2030,11 +2028,11 @@ open_read_append(std::fstream &stream) const {
 #endif
 #endif
 
 
   stream.clear();
   stream.clear();
-#ifdef WIN32_VC
+#ifdef _WIN32
   wstring os_specific = to_os_specific_w();
   wstring os_specific = to_os_specific_w();
 #else
 #else
   string os_specific = to_os_specific();
   string os_specific = to_os_specific();
-#endif  // WIN32_VC
+#endif  // _WIN32
   stream.open(os_specific.c_str(), open_mode);
   stream.open(os_specific.c_str(), open_mode);
 
 
   return (!stream.fail());
   return (!stream.fail());
@@ -2224,7 +2222,7 @@ open_read_append(pfstream &stream) const {
 bool Filename::
 bool Filename::
 touch() const {
 touch() const {
   assert(!get_pattern());
   assert(!get_pattern());
-#ifdef WIN32_VC
+#ifdef _WIN32
   // In Windows, we have to use the Windows API to do this reliably.
   // In Windows, we have to use the Windows API to do this reliably.
 
 
   // First, guarantee the file exists (and also get its handle).
   // First, guarantee the file exists (and also get its handle).
@@ -2285,14 +2283,14 @@ touch() const {
     return false;
     return false;
   }
   }
   return true;
   return true;
-#else  // WIN32, PHAVE_UTIME_H
+#else  // _WIN32, PHAVE_UTIME_H
   // Other systems may not have an explicit control over the modification
   // Other systems may not have an explicit control over the modification
   // time.  For these systems, we'll just temporarily open the file in append
   // time.  For these systems, we'll just temporarily open the file in append
   // mode, then close it again (it gets closed when the pfstream goes out of
   // mode, then close it again (it gets closed when the pfstream goes out of
   // scope).
   // scope).
   pfstream file;
   pfstream file;
   return open_append(file);
   return open_append(file);
-#endif  // WIN32, PHAVE_UTIME_H
+#endif  // _WIN32, PHAVE_UTIME_H
 }
 }
 
 
 /**
 /**
@@ -2301,13 +2299,13 @@ touch() const {
  */
  */
 bool Filename::
 bool Filename::
 chdir() const {
 chdir() const {
-#ifdef WIN32_VC
+#ifdef _WIN32
   wstring os_specific = to_os_specific_w();
   wstring os_specific = to_os_specific_w();
   return (_wchdir(os_specific.c_str()) >= 0);
   return (_wchdir(os_specific.c_str()) >= 0);
 #else
 #else
   string os_specific = to_os_specific();
   string os_specific = to_os_specific();
   return (::chdir(os_specific.c_str()) >= 0);
   return (::chdir(os_specific.c_str()) >= 0);
-#endif  // WIN32_VC
+#endif  // _WIN32
 }
 }
 
 
 /**
 /**
@@ -2318,7 +2316,7 @@ chdir() const {
 bool Filename::
 bool Filename::
 unlink() const {
 unlink() const {
   assert(!get_pattern());
   assert(!get_pattern());
-#ifdef WIN32_VC
+#ifdef _WIN32
   // Windows can't delete a file if it's read-only.  Weird.
   // Windows can't delete a file if it's read-only.  Weird.
   wstring os_specific = to_os_specific_w();
   wstring os_specific = to_os_specific_w();
   _wchmod(os_specific.c_str(), 0644);
   _wchmod(os_specific.c_str(), 0644);
@@ -2326,7 +2324,7 @@ unlink() const {
 #else
 #else
   string os_specific = to_os_specific();
   string os_specific = to_os_specific();
   return (::unlink(os_specific.c_str()) == 0);
   return (::unlink(os_specific.c_str()) == 0);
-#endif  // WIN32_VC
+#endif  // _WIN32
 }
 }
 
 
 
 
@@ -2344,7 +2342,7 @@ rename_to(const Filename &other) const {
     return true;
     return true;
   }
   }
 
 
-#ifdef WIN32_VC
+#ifdef _WIN32
   wstring os_specific = to_os_specific_w();
   wstring os_specific = to_os_specific_w();
   wstring other_os_specific = other.to_os_specific_w();
   wstring other_os_specific = other.to_os_specific_w();
 
 
@@ -2383,7 +2381,7 @@ rename_to(const Filename &other) const {
     unlink();
     unlink();
     return true;
     return true;
   }
   }
-#else  // WIN32_VC
+#else  // _WIN32
   string os_specific = to_os_specific();
   string os_specific = to_os_specific();
   string other_os_specific = other.to_os_specific();
   string other_os_specific = other.to_os_specific();
 
 
@@ -2422,7 +2420,7 @@ rename_to(const Filename &other) const {
     unlink();
     unlink();
     return true;
     return true;
   }
   }
-#endif  // WIN32_VC
+#endif  // _WIN32
 
 
   // Failed.
   // Failed.
   temp.unlink();
   temp.unlink();
@@ -2555,7 +2553,7 @@ mkdir() const {
  */
  */
 bool Filename::
 bool Filename::
 rmdir() const {
 rmdir() const {
-#ifdef WIN32_VC
+#ifdef _WIN32
   wstring os_specific = to_os_specific_w();
   wstring os_specific = to_os_specific_w();
 
 
   int result = _wrmdir(os_specific.c_str());
   int result = _wrmdir(os_specific.c_str());
@@ -2566,10 +2564,10 @@ rmdir() const {
     result = _wrmdir(os_specific.c_str());
     result = _wrmdir(os_specific.c_str());
   }
   }
 
 
-#else  // WIN32_VC
+#else  // _WIN32
   string os_specific = to_os_specific();
   string os_specific = to_os_specific();
   int result = ::rmdir(os_specific.c_str());
   int result = ::rmdir(os_specific.c_str());
-#endif  // WIN32_VC
+#endif  // _WIN32
 
 
   return (result == 0);
   return (result == 0);
 }
 }
@@ -3046,7 +3044,7 @@ r_make_canonical(const Filename &cwd) {
     return false;
     return false;
   }
   }
 
 
-#ifdef WIN32_VC
+#ifdef _WIN32
   // First, try to cd to the filename directly.
   // First, try to cd to the filename directly.
   wstring os_specific = to_os_specific_w();
   wstring os_specific = to_os_specific_w();
   if (_wchdir(os_specific.c_str()) >= 0) {
   if (_wchdir(os_specific.c_str()) >= 0) {
@@ -3060,7 +3058,7 @@ r_make_canonical(const Filename &cwd) {
     }
     }
     return true;
     return true;
   }
   }
-#else  // WIN32_VC
+#else  // _WIN32
   // First, try to cd to the filename directly.
   // First, try to cd to the filename directly.
   string os_specific = to_os_specific();
   string os_specific = to_os_specific();
   if (::chdir(os_specific.c_str()) >= 0) {
   if (::chdir(os_specific.c_str()) >= 0) {
@@ -3074,7 +3072,7 @@ r_make_canonical(const Filename &cwd) {
     }
     }
     return true;
     return true;
   }
   }
-#endif  // WIN32_VC
+#endif  // _WIN32
 
 
   // That didn't work; maybe it's not a directory.  Recursively go to the
   // That didn't work; maybe it's not a directory.  Recursively go to the
   // directory above.
   // directory above.

+ 1 - 1
dtool/src/dtoolutil/load_dso.cxx

@@ -32,7 +32,7 @@ static Filename resolve_dso(const DSearchPath &path, const Filename &filename) {
   }
   }
 }
 }
 
 
-#if defined(WIN32)
+#if defined(_WIN32)
 /* begin Win32-specific code */
 /* begin Win32-specific code */
 
 
 #define WINDOWS_LEAN_AND_MEAN
 #define WINDOWS_LEAN_AND_MEAN

+ 2 - 2
dtool/src/dtoolutil/pfstreamBuf.h

@@ -22,7 +22,7 @@
 // compiling under Windows.  Turn this off to use popen(), even on Windows.
 // compiling under Windows.  Turn this off to use popen(), even on Windows.
 // (popen() doesn't seem to work on Win9x, although it does work on NT-based
 // (popen() doesn't seem to work on Win9x, although it does work on NT-based
 // variants.)
 // variants.)
-#ifdef WIN32_VC
+#ifdef _WIN32
 #define WIN_PIPE_CALLS 1
 #define WIN_PIPE_CALLS 1
 #endif
 #endif
 
 
@@ -34,7 +34,7 @@
 
 
 #else  // WIN_PIPE_CALLS
 #else  // WIN_PIPE_CALLS
 
 
-#ifdef WIN32_VC
+#ifdef _WIN32
 #define popen _popen
 #define popen _popen
 #define pclose _pclose
 #define pclose _pclose
 #endif
 #endif

+ 1 - 1
dtool/src/dtoolutil/vector_src.h

@@ -34,7 +34,7 @@
 
 
 #include "pvector.h"
 #include "pvector.h"
 
 
-#if defined(WIN32_VC) && !defined(CPPPARSER)
+#if defined(_MSC_VER) && !defined(CPPPARSER)
 
 
   #ifdef HAVE_DINKUM
   #ifdef HAVE_DINKUM
 // With the Dinkum library, we must first export the base class, _Vector_val.
 // With the Dinkum library, we must first export the base class, _Vector_val.

+ 1 - 1
dtool/src/interrogatedb/config_interrogatedb.cxx

@@ -17,7 +17,7 @@
 #include "configVariableSearchPath.h"
 #include "configVariableSearchPath.h"
 #include "dconfig.h"
 #include "dconfig.h"
 
 
-#if defined(WIN32_VC) && defined(_DEBUG)
+#if defined(_MSC_VER) && defined(_DEBUG)
 // _DEBUG assumes you are linking to msvcrt70d.dll, not msvcrt70.dll
 // _DEBUG assumes you are linking to msvcrt70d.dll, not msvcrt70.dll
 #define USE_WIN32_DBGHEAP
 #define USE_WIN32_DBGHEAP
 #include <crtdbg.h>
 #include <crtdbg.h>

+ 4 - 4
dtool/src/prc/configPageManager.cxx

@@ -162,7 +162,7 @@ reload_implicit_pages() {
     _prc_patterns.reserve(pat_list.size());
     _prc_patterns.reserve(pat_list.size());
     for (size_t i = 0; i < pat_list.size(); ++i) {
     for (size_t i = 0; i < pat_list.size(); ++i) {
       GlobPattern glob(pat_list[i]);
       GlobPattern glob(pat_list[i]);
-#ifdef WIN32
+#ifdef _WIN32
       // On windows, the file system is case-insensitive, so the pattern
       // On windows, the file system is case-insensitive, so the pattern
       // should be too.
       // should be too.
       glob.set_case_sensitive(false);
       glob.set_case_sensitive(false);
@@ -184,7 +184,7 @@ reload_implicit_pages() {
     _prc_encrypted_patterns.reserve(pat_list.size());
     _prc_encrypted_patterns.reserve(pat_list.size());
     for (size_t i = 0; i < pat_list.size(); ++i) {
     for (size_t i = 0; i < pat_list.size(); ++i) {
       GlobPattern glob(pat_list[i]);
       GlobPattern glob(pat_list[i]);
-#ifdef WIN32
+#ifdef _WIN32
       glob.set_case_sensitive(false);
       glob.set_case_sensitive(false);
 #endif  // WIN32
 #endif  // WIN32
       _prc_encrypted_patterns.push_back(glob);
       _prc_encrypted_patterns.push_back(glob);
@@ -204,7 +204,7 @@ reload_implicit_pages() {
     _prc_executable_patterns.reserve(pat_list.size());
     _prc_executable_patterns.reserve(pat_list.size());
     for (size_t i = 0; i < pat_list.size(); ++i) {
     for (size_t i = 0; i < pat_list.size(); ++i) {
       GlobPattern glob(pat_list[i]);
       GlobPattern glob(pat_list[i]);
-#ifdef WIN32
+#ifdef _WIN32
       glob.set_case_sensitive(false);
       glob.set_case_sensitive(false);
 #endif  // WIN32
 #endif  // WIN32
       _prc_executable_patterns.push_back(glob);
       _prc_executable_patterns.push_back(glob);
@@ -481,7 +481,7 @@ reload_implicit_pages() {
   PandaFileStreamBuf::_newline_mode = newline_mode;
   PandaFileStreamBuf::_newline_mode = newline_mode;
 #endif  // USE_PANDAFILESTREAM
 #endif  // USE_PANDAFILESTREAM
 
 
-#ifdef WIN32
+#ifdef _WIN32
   // We don't necessarily want an error dialog when we fail to load a .dll
   // We don't necessarily want an error dialog when we fail to load a .dll
   // file.  But sometimes it is useful for debugging.
   // file.  But sometimes it is useful for debugging.
   ConfigVariableBool show_dll_error_dialog
   ConfigVariableBool show_dll_error_dialog

+ 3 - 3
dtool/src/prc/notify.cxx

@@ -355,7 +355,7 @@ assert_failure(const char *expression, int line,
     // Make sure the error message has been flushed to the output.
     // Make sure the error message has been flushed to the output.
     nout.flush();
     nout.flush();
 
 
-#ifdef WIN32
+#ifdef _MSC_VER
     // How to trigger an exception in VC++ that offers to take us into the
     // How to trigger an exception in VC++ that offers to take us into the
     // debugger?  abort() doesn't do it.  We used to be able to assert(false),
     // debugger?  abort() doesn't do it.  We used to be able to assert(false),
     // but in VC++ 7 that just throws an exception, and an uncaught exception
     // but in VC++ 7 that just throws an exception, and an uncaught exception
@@ -373,9 +373,9 @@ assert_failure(const char *expression, int line,
     int *ptr = nullptr;
     int *ptr = nullptr;
     *ptr = 1;
     *ptr = 1;
 
 
-#else  // WIN32
+#else  // _MSC_VER
     abort();
     abort();
-#endif  // WIN32
+#endif  // _MSC_VER
   }
   }
 
 
   return true;
   return true;

+ 2 - 2
dtool/src/prc/streamWrapper.I

@@ -124,7 +124,7 @@ INLINE OStreamWrapper::
 OStreamWrapper(std::ostream *stream, bool owns_pointer, bool stringstream_hack) :
 OStreamWrapper(std::ostream *stream, bool owns_pointer, bool stringstream_hack) :
   _ostream(stream),
   _ostream(stream),
   _owns_pointer(owns_pointer)
   _owns_pointer(owns_pointer)
-#ifdef WIN32_VC
+#ifdef _MSC_VER
 , _stringstream_hack(stringstream_hack)
 , _stringstream_hack(stringstream_hack)
 #endif
 #endif
 {
 {
@@ -137,7 +137,7 @@ INLINE OStreamWrapper::
 OStreamWrapper(std::ostream &stream) :
 OStreamWrapper(std::ostream &stream) :
   _ostream(&stream),
   _ostream(&stream),
   _owns_pointer(false)
   _owns_pointer(false)
-#ifdef WIN32_VC
+#ifdef _MSC_VER
 , _stringstream_hack(false)
 , _stringstream_hack(false)
 #endif
 #endif
 {
 {

+ 9 - 9
dtool/src/prc/streamWrapper.cxx

@@ -25,7 +25,7 @@ IStreamWrapper::
     // stream pointer does not call the appropriate global delete function;
     // stream pointer does not call the appropriate global delete function;
     // instead apparently calling the system delete function.  So we call the
     // instead apparently calling the system delete function.  So we call the
     // delete function by hand instead.
     // delete function by hand instead.
-#if !defined(WIN32_VC) && !defined(USE_MEMORY_NOWRAPPERS) && defined(REDEFINE_GLOBAL_OPERATOR_NEW)
+#if !defined(_WIN32) && !defined(USE_MEMORY_NOWRAPPERS) && defined(REDEFINE_GLOBAL_OPERATOR_NEW)
     _istream->~istream();
     _istream->~istream();
     (*global_operator_delete)(_istream);
     (*global_operator_delete)(_istream);
 #else
 #else
@@ -140,7 +140,7 @@ OStreamWrapper::
     // stream pointer does not call the appropriate global delete function;
     // stream pointer does not call the appropriate global delete function;
     // instead apparently calling the system delete function.  So we call the
     // instead apparently calling the system delete function.  So we call the
     // delete function by hand instead.
     // delete function by hand instead.
-#if !defined(WIN32_VC) && !defined(USE_MEMORY_NOWRAPPERS) && defined(REDEFINE_GLOBAL_OPERATOR_NEW)
+#if !defined(_WIN32) && !defined(USE_MEMORY_NOWRAPPERS) && defined(REDEFINE_GLOBAL_OPERATOR_NEW)
     _ostream->~ostream();
     _ostream->~ostream();
     (*global_operator_delete)(_ostream);
     (*global_operator_delete)(_ostream);
 #else
 #else
@@ -184,13 +184,13 @@ seek_write(streamsize pos, const char *buffer, streamsize num_bytes,
   _ostream->clear();
   _ostream->clear();
   _ostream->seekp(pos);
   _ostream->seekp(pos);
 
 
-#ifdef WIN32_VC
+#ifdef _MSC_VER
   if (_ostream->fail() && _stringstream_hack && pos == 0) {
   if (_ostream->fail() && _stringstream_hack && pos == 0) {
     // Ignore an unsuccessful attempt to seekp(0) if _stringstream_hack is
     // Ignore an unsuccessful attempt to seekp(0) if _stringstream_hack is
     // true.
     // true.
     _ostream->clear();
     _ostream->clear();
   }
   }
-#endif // WIN32_VC
+#endif // _MSC_VER
 
 
   _ostream->write(buffer, num_bytes);
   _ostream->write(buffer, num_bytes);
   fail = _ostream->fail();
   fail = _ostream->fail();
@@ -208,13 +208,13 @@ seek_eof_write(const char *buffer, streamsize num_bytes, bool &fail) {
   _ostream->clear();
   _ostream->clear();
   _ostream->seekp(0, std::ios::end);
   _ostream->seekp(0, std::ios::end);
 
 
-#ifdef WIN32_VC
+#ifdef _MSC_VER
   if (_ostream->fail() && _stringstream_hack) {
   if (_ostream->fail() && _stringstream_hack) {
     // Ignore an unsuccessful attempt to seekp(0) if _stringstream_hack is
     // Ignore an unsuccessful attempt to seekp(0) if _stringstream_hack is
     // true.
     // true.
     _ostream->clear();
     _ostream->clear();
   }
   }
-#endif // WIN32_VC
+#endif // _MSC_VER
 
 
   _ostream->write(buffer, num_bytes);
   _ostream->write(buffer, num_bytes);
   fail = _ostream->fail();
   fail = _ostream->fail();
@@ -232,7 +232,7 @@ seek_ppos_eof() {
   acquire();
   acquire();
   _ostream->seekp(0, std::ios::end);
   _ostream->seekp(0, std::ios::end);
 
 
-#ifdef WIN32_VC
+#ifdef _MSC_VER
   if (_ostream->fail() && _stringstream_hack) {
   if (_ostream->fail() && _stringstream_hack) {
     // Ignore an unsuccessful attempt to seekp(0) if _stringstream_hack is
     // Ignore an unsuccessful attempt to seekp(0) if _stringstream_hack is
     // true.
     // true.
@@ -240,7 +240,7 @@ seek_ppos_eof() {
     release();
     release();
     return 0;
     return 0;
   }
   }
-#endif // WIN32_VC
+#endif // _MSC_VER
 
 
   pos = _ostream->tellp();
   pos = _ostream->tellp();
   release();
   release();
@@ -258,7 +258,7 @@ StreamWrapper::
     // stream pointer does not call the appropriate global delete function;
     // stream pointer does not call the appropriate global delete function;
     // instead apparently calling the system delete function.  So we call the
     // instead apparently calling the system delete function.  So we call the
     // delete function by hand instead.
     // delete function by hand instead.
-#if !defined(WIN32_VC) && !defined(USE_MEMORY_NOWRAPPERS) && defined(REDEFINE_GLOBAL_OPERATOR_NEW)
+#if !defined(_WIN32) && !defined(USE_MEMORY_NOWRAPPERS) && defined(REDEFINE_GLOBAL_OPERATOR_NEW)
     _iostream->~iostream();
     _iostream->~iostream();
     (*global_operator_delete)(_iostream);
     (*global_operator_delete)(_iostream);
 #else
 #else

+ 1 - 1
dtool/src/prc/streamWrapper.h

@@ -110,7 +110,7 @@ private:
   // until some data has been written to the stream.  When this flag is set
   // until some data has been written to the stream.  When this flag is set
   // true, we know we have a possibly-empty stringstream, so we allow seekp(0)
   // true, we know we have a possibly-empty stringstream, so we allow seekp(0)
   // to fail silently, knowing that there's no harm in this case.
   // to fail silently, knowing that there's no harm in this case.
-#ifdef WIN32_VC
+#ifdef _MSC_VER
   bool _stringstream_hack;
   bool _stringstream_hack;
 #endif
 #endif
 };
 };

+ 1 - 1
dtool/src/test_interrogate/test_interrogate.cxx

@@ -582,7 +582,7 @@ main(int argc, char **argv) {
       Filename pathname = Filename::dso_filename(argv[i]);
       Filename pathname = Filename::dso_filename(argv[i]);
       cerr << "Loading " << pathname << "\n";
       cerr << "Loading " << pathname << "\n";
 
 
-#ifdef WIN32
+#ifdef _WIN32
       // test_interrogate always wants to show an error dialog.
       // test_interrogate always wants to show an error dialog.
       SetErrorMode(0);
       SetErrorMode(0);
 #endif
 #endif

+ 4 - 9
makepanda/makepanda.py

@@ -1121,7 +1121,7 @@ def CompileCxx(obj,src,opts):
             if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
             if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
                 cmd += " /bigobj"
                 cmd += " /bigobj"
 
 
-            cmd += " /Zm300 /DWIN32_VC /DWIN32"
+            cmd += " /Zm300"
             if 'EXCEPTIONS' in opts:
             if 'EXCEPTIONS' in opts:
                 cmd += " /EHsc"
                 cmd += " /EHsc"
             else:
             else:
@@ -1130,9 +1130,6 @@ def CompileCxx(obj,src,opts):
             if 'RTTI' not in opts:
             if 'RTTI' not in opts:
                  cmd += " /GR-"
                  cmd += " /GR-"
 
 
-            if GetTargetArch() == 'x64':
-                cmd += " /DWIN64_VC /DWIN64"
-
             cmd += " /W3 " + BracketNameWithQuotes(src)
             cmd += " /W3 " + BracketNameWithQuotes(src)
             oscmd(cmd)
             oscmd(cmd)
         else:
         else:
@@ -1213,9 +1210,7 @@ def CompileCxx(obj,src,opts):
                 cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo"    # some optimization reports
                 cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo"    # some optimization reports
             else:
             else:
                 cmd += " /W1 "
                 cmd += " /W1 "
-            cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32"
-            if GetTargetArch() == 'x64':
-                cmd += " /DWIN64_VC /DWIN64"
+            cmd += " /EHa /Zm300"
             cmd += " " + BracketNameWithQuotes(src)
             cmd += " " + BracketNameWithQuotes(src)
 
 
             oscmd(cmd)
             oscmd(cmd)
@@ -1454,9 +1449,9 @@ def CompileIgate(woutd,wsrc,opts):
     cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
     cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
     cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
     cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
     if (COMPILER=="MSVC"):
     if (COMPILER=="MSVC"):
-        cmd += ' -DWIN32_VC -DWIN32 -D_WIN32'
+        cmd += ' -D_WIN32'
         if GetTargetArch() == 'x64':
         if GetTargetArch() == 'x64':
-            cmd += ' -DWIN64_VC -DWIN64 -D_WIN64 -D_M_X64 -D_M_AMD64'
+            cmd += ' -D_WIN64 -D_M_X64 -D_M_AMD64'
         else:
         else:
             cmd += ' -D_M_IX86'
             cmd += ' -D_M_IX86'
         # NOTE: this 1600 value is the version number for VC2010.
         # NOTE: this 1600 value is the version number for VC2010.

+ 2 - 2
panda/src/audio/audioManager.cxx

@@ -21,7 +21,7 @@
 #include "config_putil.h"
 #include "config_putil.h"
 #include "load_dso.h"
 #include "load_dso.h"
 
 
-#ifdef WIN32
+#ifdef _WIN32
 #include <windows.h>  // For GetSystemDirectory()
 #include <windows.h>  // For GetSystemDirectory()
 #endif
 #endif
 
 
@@ -285,7 +285,7 @@ get_dls_pathname() {
     return dls_filename;
     return dls_filename;
   }
   }
 
 
-#ifdef WIN32
+#ifdef _WIN32
   Filename pathname;
   Filename pathname;
 
 
   // Get the registry key from DirectMusic
   // Get the registry key from DirectMusic

+ 1 - 1
panda/src/audio/config_audio.h

@@ -22,7 +22,7 @@
 #include "configVariableString.h"
 #include "configVariableString.h"
 #include "configVariableFilename.h"
 #include "configVariableFilename.h"
 
 
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _MVC_VER
 #pragma warning (disable : 4231)
 #pragma warning (disable : 4231)
 #endif
 #endif
 
 

+ 1 - 1
panda/src/display/graphicsEngine.cxx

@@ -54,7 +54,7 @@
 #include "winInputDeviceManager.h"
 #include "winInputDeviceManager.h"
 #endif
 #endif
 
 
-#if defined(WIN32)
+#if defined(_WIN32)
   #define WINDOWS_LEAN_AND_MEAN
   #define WINDOWS_LEAN_AND_MEAN
   #include <WinSock2.h>
   #include <WinSock2.h>
   #include <wtypes.h>
   #include <wtypes.h>

+ 1 - 1
panda/src/display/graphicsWindowProc.h

@@ -16,7 +16,7 @@
 
 
 #include "pandabase.h"
 #include "pandabase.h"
 
 
-#ifdef WIN32
+#ifdef _WIN32
 #ifndef WIN32_LEAN_AND_MEAN
 #ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN 1
 #define WIN32_LEAN_AND_MEAN 1
 #endif
 #endif

+ 1 - 1
panda/src/display/graphicsWindowProcCallbackData.I

@@ -27,7 +27,7 @@ get_graphics_window() const {
   return _graphicsWindow;
   return _graphicsWindow;
 }
 }
 
 
-#ifdef WIN32
+#ifdef _WIN32
 
 
 /**
 /**
  * Returns the Windows proc hwnd parameter.
  * Returns the Windows proc hwnd parameter.

+ 1 - 1
panda/src/display/graphicsWindowProcCallbackData.cxx

@@ -21,7 +21,7 @@ TypeHandle GraphicsWindowProcCallbackData::_type_handle;
  */
  */
 void GraphicsWindowProcCallbackData::
 void GraphicsWindowProcCallbackData::
 output(std::ostream &out) const {
 output(std::ostream &out) const {
-#ifdef WIN32
+#ifdef _WIN32
   out << get_type() << "(" << (void*)_graphicsWindow << ", " << _hwnd << ", "
   out << get_type() << "(" << (void*)_graphicsWindow << ", " << _hwnd << ", "
       << _msg << ", " << _wparam << ", " << _lparam << ")";
       << _msg << ", " << _wparam << ", " << _lparam << ")";
 #else
 #else

+ 3 - 3
panda/src/display/graphicsWindowProcCallbackData.h

@@ -31,7 +31,7 @@ public:
 
 
   INLINE GraphicsWindow* get_graphics_window() const;
   INLINE GraphicsWindow* get_graphics_window() const;
 
 
-#ifdef WIN32
+#ifdef _WIN32
   INLINE void set_hwnd(uintptr_t hwnd);
   INLINE void set_hwnd(uintptr_t hwnd);
   INLINE void set_msg(int msg);
   INLINE void set_msg(int msg);
   INLINE void set_wparam(int wparam);
   INLINE void set_wparam(int wparam);
@@ -41,7 +41,7 @@ public:
 PUBLISHED:
 PUBLISHED:
   virtual void output(std::ostream &out) const;
   virtual void output(std::ostream &out) const;
 
 
-#ifdef WIN32
+#ifdef _WIN32
   INLINE uintptr_t get_hwnd() const;
   INLINE uintptr_t get_hwnd() const;
   INLINE int get_msg() const;
   INLINE int get_msg() const;
   INLINE int get_wparam() const;
   INLINE int get_wparam() const;
@@ -54,7 +54,7 @@ PUBLISHED:
 
 
 private:
 private:
   GraphicsWindow* _graphicsWindow;
   GraphicsWindow* _graphicsWindow;
-#ifdef WIN32
+#ifdef _WIN32
   uintptr_t _hwnd;
   uintptr_t _hwnd;
   int _msg;
   int _msg;
   int _wparam;
   int _wparam;

+ 2 - 2
panda/src/display/nativeWindowHandle.I

@@ -60,7 +60,7 @@ get_handle() const {
 }
 }
 #endif  // HAVE_X11
 #endif  // HAVE_X11
 
 
-#if defined(WIN32) && !defined(CPPPARSER)
+#if defined(_WIN32) && !defined(CPPPARSER)
 /**
 /**
  *
  *
  */
  */
@@ -69,7 +69,7 @@ WinHandle(HWND handle) : _handle(handle) {
 }
 }
 #endif  // WIN32
 #endif  // WIN32
 
 
-#if defined(WIN32) && !defined(CPPPARSER)
+#if defined(_WIN32) && !defined(CPPPARSER)
 /**
 /**
  *
  *
  */
  */

+ 6 - 6
panda/src/display/nativeWindowHandle.cxx

@@ -22,7 +22,7 @@ TypeHandle NativeWindowHandle::SubprocessHandle::_type_handle;
 #if defined(HAVE_X11) && !defined(CPPPARSER)
 #if defined(HAVE_X11) && !defined(CPPPARSER)
 TypeHandle NativeWindowHandle::X11Handle::_type_handle;
 TypeHandle NativeWindowHandle::X11Handle::_type_handle;
 #endif
 #endif
-#if defined(WIN32) && !defined(CPPPARSER)
+#if defined(_WIN32) && !defined(CPPPARSER)
 TypeHandle NativeWindowHandle::WinHandle::_type_handle;
 TypeHandle NativeWindowHandle::WinHandle::_type_handle;
 #endif
 #endif
 
 
@@ -60,7 +60,7 @@ make_x11(X11_Window window) {
 }
 }
 #endif  // HAVE_X11
 #endif  // HAVE_X11
 
 
-#if defined(WIN32) && !defined(CPPPARSER)
+#if defined(_WIN32) && !defined(CPPPARSER)
 /**
 /**
  * Constructs a new WindowHandle that references a window on Windows.
  * Constructs a new WindowHandle that references a window on Windows.
  */
  */
@@ -68,7 +68,7 @@ PT(WindowHandle) NativeWindowHandle::
 make_win(HWND window) {
 make_win(HWND window) {
   return new WindowHandle(new WinHandle(window));
   return new WindowHandle(new WinHandle(window));
 }
 }
-#endif  // WIN32
+#endif  // _WIN32
 
 
 /**
 /**
  * Returns the OS-specific handle converted to an integer, if this is possible
  * Returns the OS-specific handle converted to an integer, if this is possible
@@ -116,7 +116,7 @@ output(ostream &out) const {
 }
 }
 #endif  // HAVE_X11
 #endif  // HAVE_X11
 
 
-#if defined(WIN32) && !defined(CPPPARSER)
+#if defined(_WIN32) && !defined(CPPPARSER)
 /**
 /**
  * Returns the OS-specific handle converted to an integer, if this is possible
  * Returns the OS-specific handle converted to an integer, if this is possible
  * for the particular representation.  Returns 0 if it is not.
  * for the particular representation.  Returns 0 if it is not.
@@ -125,9 +125,9 @@ size_t NativeWindowHandle::WinHandle::
 get_int_handle() const {
 get_int_handle() const {
   return (size_t)_handle;
   return (size_t)_handle;
 }
 }
-#endif  // WIN32
+#endif  // _WIN32
 
 
-#if defined(WIN32) && !defined(CPPPARSER)
+#if defined(_WIN32) && !defined(CPPPARSER)
 /**
 /**
  *
  *
  */
  */

+ 4 - 4
panda/src/display/nativeWindowHandle.h

@@ -19,7 +19,7 @@
 #include "windowHandle.h"
 #include "windowHandle.h"
 #include "get_x11.h"
 #include "get_x11.h"
 
 
-#ifdef WIN32
+#ifdef _WIN32
 #ifndef WIN32_LEAN_AND_MEAN
 #ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN 1
 #define WIN32_LEAN_AND_MEAN 1
 #endif
 #endif
@@ -47,7 +47,7 @@ public:
   static PT(WindowHandle) make_x11(X11_Window window);
   static PT(WindowHandle) make_x11(X11_Window window);
 #endif  // HAVE_X11
 #endif  // HAVE_X11
 
 
-#if defined(WIN32) && !defined(CPPPARSER)
+#if defined(_WIN32) && !defined(CPPPARSER)
   static PT(WindowHandle) make_win(HWND window);
   static PT(WindowHandle) make_win(HWND window);
 #endif  // WIN32
 #endif  // WIN32
 
 
@@ -141,7 +141,7 @@ public:
 #endif  // HAVE_X11
 #endif  // HAVE_X11
 
 
 
 
-#if defined(WIN32) && !defined(CPPPARSER)
+#if defined(_WIN32) && !defined(CPPPARSER)
   class EXPCL_PANDA_DISPLAY WinHandle : public OSHandle {
   class EXPCL_PANDA_DISPLAY WinHandle : public OSHandle {
   public:
   public:
     INLINE WinHandle(HWND handle);
     INLINE WinHandle(HWND handle);
@@ -186,7 +186,7 @@ public:
 #if defined(HAVE_X11) && !defined(CPPPARSER)
 #if defined(HAVE_X11) && !defined(CPPPARSER)
     X11Handle::init_type();
     X11Handle::init_type();
 #endif
 #endif
-#if defined(WIN32) && !defined(CPPPARSER)
+#if defined(_WIN32) && !defined(CPPPARSER)
     WinHandle::init_type();
     WinHandle::init_type();
 #endif
 #endif
   }
   }

+ 6 - 6
panda/src/downloader/bioStreamBuf.cxx

@@ -18,11 +18,11 @@
 
 
 #ifdef HAVE_OPENSSL
 #ifdef HAVE_OPENSSL
 
 
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
   #include <WinSock2.h>
   #include <WinSock2.h>
   #include <windows.h>  // for WSAGetLastError()
   #include <windows.h>  // for WSAGetLastError()
   #undef X509_NAME
   #undef X509_NAME
-#endif  // WIN32_VC
+#endif  // _WIN32
 
 
 /**
 /**
  *
  *
@@ -162,11 +162,11 @@ underflow() {
       if (read_count <= 0) {
       if (read_count <= 0) {
         // Immediately save the os error in case we screw up and do something
         // Immediately save the os error in case we screw up and do something
         // that will change its value before we can output it.
         // that will change its value before we can output it.
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
         int os_error = WSAGetLastError();
         int os_error = WSAGetLastError();
 #else
 #else
         int os_error = errno;
         int os_error = errno;
-#endif  // WIN32_VC
+#endif  // _WIN32
 
 
         // Though BIO_eof() is tempting, it appears there are cases in which
         // Though BIO_eof() is tempting, it appears there are cases in which
         // that never returns true, if the socket is closed by the server.
         // that never returns true, if the socket is closed by the server.
@@ -197,13 +197,13 @@ underflow() {
               << "\n";
               << "\n";
           }
           }
 
 
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
           downloader_cat.warning()
           downloader_cat.warning()
             << "Windows error code: " << os_error << "\n";
             << "Windows error code: " << os_error << "\n";
 #else
 #else
           downloader_cat.warning()
           downloader_cat.warning()
             << "Unix error code: " << os_error << "\n";
             << "Unix error code: " << os_error << "\n";
-#endif  // WIN32_VC
+#endif  // _WIN32
         }
         }
         gbump(num_bytes);
         gbump(num_bytes);
         return EOF;
         return EOF;

+ 2 - 2
panda/src/downloader/httpChannel.cxx

@@ -29,11 +29,11 @@
 
 
 #include "openSSLWrapper.h"
 #include "openSSLWrapper.h"
 
 
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
   #include <WinSock2.h>
   #include <WinSock2.h>
   #include <windows.h>  // for select()
   #include <windows.h>  // for select()
   #undef X509_NAME
   #undef X509_NAME
-#endif  // WIN32_VC
+#endif  // _WIN32
 
 
 using std::istream;
 using std::istream;
 using std::min;
 using std::min;

+ 2 - 2
panda/src/downloader/multiplexStreamBuf.cxx

@@ -13,7 +13,7 @@
 
 
 #include "multiplexStreamBuf.h"
 #include "multiplexStreamBuf.h"
 
 
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
 #define WINDOWS_LEAN_AND_MEAN
 #define WINDOWS_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
 #undef WINDOWS_LEAN_AND_MEAN
 #undef WINDOWS_LEAN_AND_MEAN
@@ -68,7 +68,7 @@ write_string(const string &str) {
     break;
     break;
 
 
   case OT_system_debug:
   case OT_system_debug:
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
     OutputDebugString(str.c_str());
     OutputDebugString(str.c_str());
 #endif
 #endif
     break;
     break;

+ 1 - 1
panda/src/egg/eggGroupNode.h

@@ -70,7 +70,7 @@ PUBLISHED:
   // limited add_childremove_child or inserterase interface.  The following
   // limited add_childremove_child or inserterase interface.  The following
   // implements this.
   // implements this.
 public:
 public:
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
   typedef const PT(EggNode) *pointer;
   typedef const PT(EggNode) *pointer;
   typedef const PT(EggNode) *const_pointer;
   typedef const PT(EggNode) *const_pointer;
 #else
 #else

+ 1 - 1
panda/src/egg/eggPrimitive.h

@@ -140,7 +140,7 @@ PUBLISHED:
   // through the limited add_vertexremove_vertex or inserterase interface.
   // through the limited add_vertexremove_vertex or inserterase interface.
   // The following implements this.
   // The following implements this.
 public:
 public:
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
   typedef PT_EggVertex *pointer;
   typedef PT_EggVertex *pointer;
   typedef PT_EggVertex *const_pointer;
   typedef PT_EggVertex *const_pointer;
 #else
 #else

+ 3 - 3
panda/src/express/error_utils.cxx

@@ -153,7 +153,7 @@ string error_to_text(ErrorUtilCode err) {
  */
  */
 int
 int
 get_write_error() {
 get_write_error() {
-#if !defined(WIN32) && !defined(WIN64)
+#ifndef _WIN32
   return EU_error_abort;
   return EU_error_abort;
 #else
 #else
   switch (errno) {
   switch (errno) {
@@ -189,7 +189,7 @@ get_write_error() {
  *
  *
  */
  */
 string handle_socket_error() {
 string handle_socket_error() {
-#if !defined(WIN32) && !defined(WIN64)
+#ifndef _WIN32
   return string(strerror(errno));
   return string(strerror(errno));
 #else
 #else
   int err = WSAGetLastError();
   int err = WSAGetLastError();
@@ -248,7 +248,7 @@ string handle_socket_error() {
  */
  */
 int
 int
 get_network_error() {
 get_network_error() {
-#if !defined(WIN32) && !defined(WIN64)
+#ifndef _WIN32
   return EU_error_abort;
   return EU_error_abort;
 #else
 #else
   int err = WSAGetLastError();
   int err = WSAGetLastError();

+ 4 - 4
panda/src/express/memoryUsage.cxx

@@ -18,7 +18,7 @@
 #include "mutexImpl.h"
 #include "mutexImpl.h"
 #include "interrogate_request.h"
 #include "interrogate_request.h"
 
 
-#if (defined(WIN32_VC) || defined (WIN64_VC)) && defined(_DEBUG)
+#if defined(_MSC_VER) && defined(_DEBUG)
 #include <crtdbg.h>
 #include <crtdbg.h>
 #endif
 #endif
 
 
@@ -426,7 +426,7 @@ mark_pointer(void *ptr, size_t size, ReferenceCount *ref_ptr) {
 #endif
 #endif
 }
 }
 
 
-#if (defined(WIN32_VC) || defined (WIN64_VC))&& defined(_DEBUG)
+#if defined(_WIN32) && defined(_DEBUG)
 /**
 /**
  * This callback is attached to the Win32 debug malloc system to be called
  * This callback is attached to the Win32 debug malloc system to be called
  * whenever a pointer is allocated, reallocated, or freed.  It's used to track
  * whenever a pointer is allocated, reallocated, or freed.  It's used to track
@@ -455,7 +455,7 @@ win32_malloc_hook(int alloc_type, void *ptr,
   mu->_total_size += increment;
   mu->_total_size += increment;
   return true;
   return true;
 }
 }
-#endif  // WIN32_VC && _DEBUG
+#endif  // _WIN32 && _DEBUG
 
 
 
 
 
 
@@ -520,7 +520,7 @@ MemoryUsage(const MemoryHook &copy) :
 #error Cannot compile MemoryUsage without malloc wrappers!
 #error Cannot compile MemoryUsage without malloc wrappers!
 #endif
 #endif
 
 
-#if (defined(WIN32_VC) || defined(WIN64_VC)) && defined(_DEBUG)
+#ifdef _MSC_VER
   // On a debug Windows build, we can set this malloc hook which allows
   // On a debug Windows build, we can set this malloc hook which allows
   // tracking every malloc call, even from subordinate libraries.
   // tracking every malloc call, even from subordinate libraries.
   _CrtSetAllocHook(&win32_malloc_hook);
   _CrtSetAllocHook(&win32_malloc_hook);

+ 1 - 1
panda/src/express/memoryUsage.h

@@ -55,7 +55,7 @@ protected:
 
 
   virtual void mark_pointer(void *ptr, size_t orig_size, ReferenceCount *ref_ptr);
   virtual void mark_pointer(void *ptr, size_t orig_size, ReferenceCount *ref_ptr);
 
 
-#if (defined(WIN32_VC) || defined(WIN64_VC)) && defined(_DEBUG)
+#if defined(_WIN32) && defined(_DEBUG)
   static int win32_malloc_hook(int alloc_type, void *ptr,
   static int win32_malloc_hook(int alloc_type, void *ptr,
                                size_t size, int block_use, long request,
                                size_t size, int block_use, long request,
                                const unsigned char *filename, int line);
                                const unsigned char *filename, int line);

+ 1 - 1
panda/src/express/multifile.cxx

@@ -1631,7 +1631,7 @@ close_read_subfile(istream *stream) {
     // stream pointer does not call the appropriate global delete function;
     // stream pointer does not call the appropriate global delete function;
     // instead apparently calling the system delete function.  So we call the
     // instead apparently calling the system delete function.  So we call the
     // delete function by hand instead.
     // delete function by hand instead.
-#if !defined(WIN32_VC) && !defined(USE_MEMORY_NOWRAPPERS) && defined(REDEFINE_GLOBAL_OPERATOR_NEW)
+#if defined(__GNUC__) && !defined(USE_MEMORY_NOWRAPPERS) && defined(REDEFINE_GLOBAL_OPERATOR_NEW)
     stream->~istream();
     stream->~istream();
     (*global_operator_delete)(stream);
     (*global_operator_delete)(stream);
 #else
 #else

+ 2 - 2
panda/src/express/pointerToArray.I

@@ -297,7 +297,7 @@ erase(iterator first, iterator last) {
   ((To *)(this->_void_ptr))->erase(first, last);
   ((To *)(this->_void_ptr))->erase(first, last);
 }
 }
 
 
-#if !defined(WIN32_VC) && !defined(WIN64_VC)
+#ifndef _WIN32
 /**
 /**
  *
  *
  */
  */
@@ -844,7 +844,7 @@ back() const {
   return ((To *)(this->_void_ptr))->back();
   return ((To *)(this->_void_ptr))->back();
 }
 }
 
 
-#if !defined(WIN32_VC) && !defined(WIN64_VC)
+#ifndef _WIN32
 /**
 /**
  *
  *
  */
  */

+ 4 - 4
panda/src/express/pointerToArray.h

@@ -61,7 +61,7 @@
 
 
 #include "pointerToArrayBase.h"
 #include "pointerToArrayBase.h"
 
 
-#if (defined(WIN32_VC) || defined(WIN64_VC)) && !defined(__INTEL_COMPILER)
+#if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
 // disable mysterious MSVC warning for static inline PTA::empty_array method
 // disable mysterious MSVC warning for static inline PTA::empty_array method
 // need to chk if vc 7.0 still has this problem, would like to keep it enabled
 // need to chk if vc 7.0 still has this problem, would like to keep it enabled
 #pragma warning (disable : 4506)
 #pragma warning (disable : 4506)
@@ -179,7 +179,7 @@ public:
   INLINE void erase(iterator position);
   INLINE void erase(iterator position);
   INLINE void erase(iterator first, iterator last);
   INLINE void erase(iterator first, iterator last);
 
 
-#if !defined(WIN32_VC) && !defined (WIN64_VC)
+#ifndef _WIN32
   INLINE reference operator [](size_type n) const;
   INLINE reference operator [](size_type n) const;
   INLINE reference operator [](int n) const;
   INLINE reference operator [](int n) const;
 #endif
 #endif
@@ -285,7 +285,7 @@ PUBLISHED:
   typedef typename pvector<Element>::const_reference const_reference;
   typedef typename pvector<Element>::const_reference const_reference;
   typedef typename pvector<Element>::const_iterator iterator;
   typedef typename pvector<Element>::const_iterator iterator;
   typedef typename pvector<Element>::const_iterator const_iterator;
   typedef typename pvector<Element>::const_iterator const_iterator;
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _MSC_VER
   // VC++ seems to break the const_reverse_iterator definition somehow.
   // VC++ seems to break the const_reverse_iterator definition somehow.
   typedef typename pvector<Element>::reverse_iterator reverse_iterator;
   typedef typename pvector<Element>::reverse_iterator reverse_iterator;
 #else
 #else
@@ -323,7 +323,7 @@ PUBLISHED:
   INLINE reference front() const;
   INLINE reference front() const;
   INLINE reference back() const;
   INLINE reference back() const;
 
 
-#if !defined(WIN32_VC) && !defined(WIN64_VC)
+#ifndef _WIN32
   INLINE reference operator [](size_type n) const;
   INLINE reference operator [](size_type n) const;
   INLINE reference operator [](int n) const;
   INLINE reference operator [](int n) const;
 #endif
 #endif

+ 3 - 3
panda/src/express/trueClock.I

@@ -11,7 +11,7 @@
  * @date 2000-07-04
  * @date 2000-07-04
  */
  */
 
 
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
 
 
 /**
 /**
  *
  *
@@ -36,7 +36,7 @@ get_short_time() {
   return time;
   return time;
 }
 }
 
 
-#else  // WIN32_VC
+#else  // _WIN32
 
 
 /**
 /**
  *
  *
@@ -46,7 +46,7 @@ get_short_time() {
   return get_short_raw_time();
   return get_short_raw_time();
 }
 }
 
 
-#endif  // WIN32_VC
+#endif  // _WIN32
 
 
 
 
 /**
 /**

+ 2 - 2
panda/src/express/trueClock.cxx

@@ -22,7 +22,7 @@ using std::min;
 
 
 TrueClock *TrueClock::_global_ptr = nullptr;
 TrueClock *TrueClock::_global_ptr = nullptr;
 
 
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
 
 
 // The Win32 implementation.
 // The Win32 implementation.
 
 
@@ -471,7 +471,7 @@ set_time_scale(double time, double new_time_scale) {
   _time_scale = new_time_scale;
   _time_scale = new_time_scale;
 }
 }
 
 
-#else  // !WIN32_VC
+#else  // !_WIN32
 
 
 // The Posix implementation.
 // The Posix implementation.
 
 

+ 1 - 1
panda/src/express/trueClock.h

@@ -64,7 +64,7 @@ protected:
 
 
   static TrueClock *_global_ptr;
   static TrueClock *_global_ptr;
 
 
-#ifdef WIN32
+#ifdef _WIN32
   double correct_time(double time);
   double correct_time(double time);
   void set_time_scale(double time, double new_time_scale);
   void set_time_scale(double time, double new_time_scale);
 
 

+ 12 - 12
panda/src/express/virtualFileMountSystem.cxx

@@ -30,7 +30,7 @@ TypeHandle VirtualFileMountSystem::_type_handle;
 bool VirtualFileMountSystem::
 bool VirtualFileMountSystem::
 has_file(const Filename &file) const {
 has_file(const Filename &file) const {
   Filename pathname(_physical_filename, file);
   Filename pathname(_physical_filename, file);
-#ifdef WIN32
+#ifdef _WIN32
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
     Filename case_pathname = pathname;
     Filename case_pathname = pathname;
     if (!case_pathname.make_true_case()) {
     if (!case_pathname.make_true_case()) {
@@ -115,7 +115,7 @@ make_directory(const Filename &file) {
  */
  */
 bool VirtualFileMountSystem::
 bool VirtualFileMountSystem::
 is_directory(const Filename &file) const {
 is_directory(const Filename &file) const {
-#ifdef WIN32
+#ifdef _WIN32
   // First ensure that the file exists to validate its case.
   // First ensure that the file exists to validate its case.
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
     if (!has_file(file)) {
     if (!has_file(file)) {
@@ -133,7 +133,7 @@ is_directory(const Filename &file) const {
  */
  */
 bool VirtualFileMountSystem::
 bool VirtualFileMountSystem::
 is_regular_file(const Filename &file) const {
 is_regular_file(const Filename &file) const {
-#ifdef WIN32
+#ifdef _WIN32
   // First ensure that the file exists to validate its case.
   // First ensure that the file exists to validate its case.
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
     if (!has_file(file)) {
     if (!has_file(file)) {
@@ -151,7 +151,7 @@ is_regular_file(const Filename &file) const {
  */
  */
 bool VirtualFileMountSystem::
 bool VirtualFileMountSystem::
 is_writable(const Filename &file) const {
 is_writable(const Filename &file) const {
-#ifdef WIN32
+#ifdef _WIN32
   // First ensure that the file exists to validate its case.
   // First ensure that the file exists to validate its case.
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
     if (!has_file(file)) {
     if (!has_file(file)) {
@@ -170,7 +170,7 @@ is_writable(const Filename &file) const {
  */
  */
 istream *VirtualFileMountSystem::
 istream *VirtualFileMountSystem::
 open_read_file(const Filename &file) const {
 open_read_file(const Filename &file) const {
-#ifdef WIN32
+#ifdef _WIN32
   // First ensure that the file exists to validate its case.
   // First ensure that the file exists to validate its case.
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
     if (!has_file(file)) {
     if (!has_file(file)) {
@@ -196,7 +196,7 @@ open_read_file(const Filename &file) const {
  */
  */
 ostream *VirtualFileMountSystem::
 ostream *VirtualFileMountSystem::
 open_write_file(const Filename &file, bool truncate) {
 open_write_file(const Filename &file, bool truncate) {
-#ifdef WIN32
+#ifdef _WIN32
   // First ensure that the file exists to validate its case.
   // First ensure that the file exists to validate its case.
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
     if (!has_file(file)) {
     if (!has_file(file)) {
@@ -222,7 +222,7 @@ open_write_file(const Filename &file, bool truncate) {
  */
  */
 ostream *VirtualFileMountSystem::
 ostream *VirtualFileMountSystem::
 open_append_file(const Filename &file) {
 open_append_file(const Filename &file) {
-#ifdef WIN32
+#ifdef _WIN32
   // First ensure that the file exists to validate its case.
   // First ensure that the file exists to validate its case.
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
     if (!has_file(file)) {
     if (!has_file(file)) {
@@ -248,7 +248,7 @@ open_append_file(const Filename &file) {
  */
  */
 iostream *VirtualFileMountSystem::
 iostream *VirtualFileMountSystem::
 open_read_write_file(const Filename &file, bool truncate) {
 open_read_write_file(const Filename &file, bool truncate) {
-#ifdef WIN32
+#ifdef _WIN32
   // First ensure that the file exists to validate its case.
   // First ensure that the file exists to validate its case.
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
     if (!has_file(file)) {
     if (!has_file(file)) {
@@ -274,7 +274,7 @@ open_read_write_file(const Filename &file, bool truncate) {
  */
  */
 iostream *VirtualFileMountSystem::
 iostream *VirtualFileMountSystem::
 open_read_append_file(const Filename &file) {
 open_read_append_file(const Filename &file) {
-#ifdef WIN32
+#ifdef _WIN32
   // First ensure that the file exists to validate its case.
   // First ensure that the file exists to validate its case.
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
     if (!has_file(file)) {
     if (!has_file(file)) {
@@ -368,7 +368,7 @@ get_system_info(const Filename &file, SubfileInfo &info) {
  */
  */
 bool VirtualFileMountSystem::
 bool VirtualFileMountSystem::
 scan_directory(vector_string &contents, const Filename &dir) const {
 scan_directory(vector_string &contents, const Filename &dir) const {
-#ifdef WIN32
+#ifdef _WIN32
   // First ensure that the file exists to validate its case.
   // First ensure that the file exists to validate its case.
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
     if (!has_file(dir)) {
     if (!has_file(dir)) {
@@ -388,7 +388,7 @@ bool VirtualFileMountSystem::
 atomic_compare_and_exchange_contents(const Filename &file, string &orig_contents,
 atomic_compare_and_exchange_contents(const Filename &file, string &orig_contents,
                                      const string &old_contents,
                                      const string &old_contents,
                                      const string &new_contents) {
                                      const string &new_contents) {
-#ifdef WIN32
+#ifdef _WIN32
   // First ensure that the file exists to validate its case.
   // First ensure that the file exists to validate its case.
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
     if (!has_file(file)) {
     if (!has_file(file)) {
@@ -405,7 +405,7 @@ atomic_compare_and_exchange_contents(const Filename &file, string &orig_contents
  */
  */
 bool VirtualFileMountSystem::
 bool VirtualFileMountSystem::
 atomic_read_contents(const Filename &file, string &contents) const {
 atomic_read_contents(const Filename &file, string &contents) const {
-#ifdef WIN32
+#ifdef _WIN32
   // First ensure that the file exists to validate its case.
   // First ensure that the file exists to validate its case.
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
   if (VirtualFileSystem::get_global_ptr()->vfs_case_sensitive) {
     if (!has_file(file)) {
     if (!has_file(file)) {

+ 3 - 3
panda/src/express/virtualFileSystem.cxx

@@ -870,7 +870,7 @@ close_read_file(istream *stream) {
     // stream pointer does not call the appropriate global delete function;
     // stream pointer does not call the appropriate global delete function;
     // instead apparently calling the system delete function.  So we call the
     // instead apparently calling the system delete function.  So we call the
     // delete function by hand instead.
     // delete function by hand instead.
-#if (!defined(WIN32_VC) && !defined(WIN64_VC)) && !defined(USE_MEMORY_NOWRAPPERS) && defined(REDEFINE_GLOBAL_OPERATOR_NEW)
+#if defined(__GNUC__) && !defined(USE_MEMORY_NOWRAPPERS) && defined(REDEFINE_GLOBAL_OPERATOR_NEW)
     stream->~istream();
     stream->~istream();
     (*global_operator_delete)(stream);
     (*global_operator_delete)(stream);
 #else
 #else
@@ -929,7 +929,7 @@ open_append_file(const Filename &filename) {
 void VirtualFileSystem::
 void VirtualFileSystem::
 close_write_file(ostream *stream) {
 close_write_file(ostream *stream) {
   if (stream != nullptr) {
   if (stream != nullptr) {
-#if (!defined(WIN32_VC) && !defined(WIN64_VC)) && !defined(USE_MEMORY_NOWRAPPERS) && defined(REDEFINE_GLOBAL_OPERATOR_NEW)
+#if defined(__GNUC__) && !defined(USE_MEMORY_NOWRAPPERS) && defined(REDEFINE_GLOBAL_OPERATOR_NEW)
     stream->~ostream();
     stream->~ostream();
     (*global_operator_delete)(stream);
     (*global_operator_delete)(stream);
 #else
 #else
@@ -985,7 +985,7 @@ open_read_append_file(const Filename &filename) {
 void VirtualFileSystem::
 void VirtualFileSystem::
 close_read_write_file(iostream *stream) {
 close_read_write_file(iostream *stream) {
   if (stream != nullptr) {
   if (stream != nullptr) {
-#if (!defined(WIN32_VC) && !defined(WIN64_VC)) && !defined(USE_MEMORY_NOWRAPPERS) && defined(REDEFINE_GLOBAL_OPERATOR_NEW)
+#if defined(__GNUC__) && !defined(USE_MEMORY_NOWRAPPERS) && defined(REDEFINE_GLOBAL_OPERATOR_NEW)
     stream->~iostream();
     stream->~iostream();
     (*global_operator_delete)(stream);
     (*global_operator_delete)(stream);
 #else
 #else

+ 1 - 1
panda/src/glstuff/glmisc_src.h

@@ -87,7 +87,7 @@ extern ConfigVariableEnum<CoordinateSystem> gl_coordinate_system;
 extern EXPCL_GL void CLP(init_classes)();
 extern EXPCL_GL void CLP(init_classes)();
 
 
 
 
-#if !defined(WIN32) && defined(GSG_VERBOSE)
+#if !defined(_WIN32) && defined(GSG_VERBOSE)
 std::ostream &output_gl_enum(std::ostream &out, GLenum v);
 std::ostream &output_gl_enum(std::ostream &out, GLenum v);
 INLINE std::ostream &operator << (std::ostream &out, GLenum v) {
 INLINE std::ostream &operator << (std::ostream &out, GLenum v) {
   return output_gl_enum(out, v);
   return output_gl_enum(out, v);

+ 1 - 1
panda/src/glstuff/glpure.cxx

@@ -16,7 +16,7 @@
 // This is the one file in this directory which is actually compiled.  It
 // This is the one file in this directory which is actually compiled.  It
 // exists just so we can have some symbols and make the compiler happy.
 // exists just so we can have some symbols and make the compiler happy.
 
 
-#if (defined(WIN32_VC) || defined(WIN64_VC)) && !defined(CPPPARSER) && !defined(LINK_ALL_STATIC)
+#if defined(_WIN32) && !defined(CPPPARSER) && !defined(LINK_ALL_STATIC)
 __declspec(dllexport)
 __declspec(dllexport)
 #endif
 #endif
 int glpure;
 int glpure;

+ 1 - 1
panda/src/grutil/frameRateMeter.cxx

@@ -214,7 +214,7 @@ do_update(Thread *current_thread) {
 
 
   static const size_t buffer_size = 1024;
   static const size_t buffer_size = 1024;
   char buffer[buffer_size];
   char buffer[buffer_size];
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
   // Windows doesn't define snprintf().  Hope we don't overflow.
   // Windows doesn't define snprintf().  Hope we don't overflow.
   sprintf(buffer, _text_pattern.c_str(), value, deviation);
   sprintf(buffer, _text_pattern.c_str(), value, deviation);
 #else
 #else

+ 1 - 1
panda/src/grutil/sceneGraphAnalyzerMeter.cxx

@@ -206,7 +206,7 @@ do_update(Thread *current_thread) {
                         "Points: %d\n"
                         "Points: %d\n"
                         "Texture memory: %.1f KB\n";
                         "Texture memory: %.1f KB\n";
 
 
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
   _snprintf(buffer, buffer_size, pattern,
   _snprintf(buffer, buffer_size, pattern,
           _scene_graph_analyzer.get_num_nodes(),
           _scene_graph_analyzer.get_num_nodes(),
           _scene_graph_analyzer.get_num_instances(),
           _scene_graph_analyzer.get_num_instances(),

+ 2 - 2
panda/src/nativenet/socket_fdset.h

@@ -52,7 +52,7 @@ inline Socket_fdset::Socket_fdset() {
 inline void Socket_fdset::setForSocketNative(SOCKET inid)
 inline void Socket_fdset::setForSocketNative(SOCKET inid)
 {
 {
     assert( inid >= 0);
     assert( inid >= 0);
-#ifndef WIN32
+#ifndef _WIN32
     assert(inid < FD_SETSIZE);
     assert(inid < FD_SETSIZE);
 #endif
 #endif
 
 
@@ -68,7 +68,7 @@ inline void Socket_fdset::setForSocketNative(SOCKET inid)
 inline bool Socket_fdset::isSetForNative(SOCKET inid) const
 inline bool Socket_fdset::isSetForNative(SOCKET inid) const
 {
 {
     assert( inid >= 0);
     assert( inid >= 0);
-#ifndef WIN32
+#ifndef _WIN32
     assert(inid < FD_SETSIZE);
     assert(inid < FD_SETSIZE);
 #endif
 #endif
 
 

+ 2 - 2
panda/src/nativenet/time_base.h

@@ -14,7 +14,7 @@
  * returning the current system time ?? So use time functions that grab the
  * returning the current system time ?? So use time functions that grab the
  * current system time sparingly ??
  * current system time sparingly ??
  */
  */
-#ifdef WIN32
+#ifdef _WIN32
 #include <winsock2.h>
 #include <winsock2.h>
 #include <wtypes.h>
 #include <wtypes.h>
 #include <sys/types.h>
 #include <sys/types.h>
@@ -64,7 +64,7 @@ inline void TimeAdd(const struct timeval &start, const struct timeval &delta, st
     NormalizeTime(answer);
     NormalizeTime(answer);
 }
 }
 
 
-#ifdef WIN32
+#ifdef _WIN32
 // Lets make Windows think it is a unix machine :)
 // Lets make Windows think it is a unix machine :)
 
 
 /**
 /**

+ 3 - 3
panda/src/net/connectionManager.cxx

@@ -478,7 +478,7 @@ scan_interfaces() {
   _interfaces.clear();
   _interfaces.clear();
   _interfaces_scanned = true;
   _interfaces_scanned = true;
 
 
-#ifdef WIN32_VC
+#ifdef _WIN32
   int flags = GAA_FLAG_INCLUDE_PREFIX | GAA_FLAG_SKIP_UNICAST | GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_DNS_SERVER;
   int flags = GAA_FLAG_INCLUDE_PREFIX | GAA_FLAG_SKIP_UNICAST | GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_DNS_SERVER;
   ULONG family = support_ipv6 ? AF_UNSPEC : AF_INET;
   ULONG family = support_ipv6 ? AF_UNSPEC : AF_INET;
   ULONG buffer_size = 0;
   ULONG buffer_size = 0;
@@ -544,7 +544,7 @@ scan_interfaces() {
 #elif defined(__ANDROID__)
 #elif defined(__ANDROID__)
   // TODO: implementation using netlink_socket?
   // TODO: implementation using netlink_socket?
 
 
-#else  // WIN32_VC
+#else  // _WIN32
   struct ifaddrs *ifa;
   struct ifaddrs *ifa;
   if (getifaddrs(&ifa) != 0) {
   if (getifaddrs(&ifa) != 0) {
     // Failure.
     // Failure.
@@ -578,7 +578,7 @@ scan_interfaces() {
 
 
   freeifaddrs(ifa);
   freeifaddrs(ifa);
 
 
-#endif // WIN32_VC
+#endif // _WIN32
 }
 }
 
 
 /**
 /**

+ 1 - 1
panda/src/pandabase/pandasymbols.h

@@ -587,7 +587,7 @@
   #define EXPTP_VRPN IMPORT_TEMPL
   #define EXPTP_VRPN IMPORT_TEMPL
 #endif
 #endif
 
 
-#if (defined(WIN32_VC) || defined(WIN64_VC)) && !defined(CPPPARSER)
+#if defined(_MSC_VER) && !defined(CPPPARSER)
 #define INLINE_LINMATH __forceinline
 #define INLINE_LINMATH __forceinline
 #define INLINE_MATHUTIL __forceinline
 #define INLINE_MATHUTIL __forceinline
 
 

+ 1 - 1
panda/src/pgraph/findApproxPath.h

@@ -59,7 +59,7 @@ public:
   void output(std::ostream &out) const;
   void output(std::ostream &out) const;
   INLINE void output_component(std::ostream &out, int index) const;
   INLINE void output_component(std::ostream &out, int index) const;
 
 
-#if !defined(WIN32_VC) && !defined(WIN64_VC)
+#ifndef _MSC_VER
 // Visual C++ won't let us define the ostream operator functions for these
 // Visual C++ won't let us define the ostream operator functions for these
 // guys if they're private--even though we declare them friends.
 // guys if they're private--even though we declare them friends.
 private:
 private:

+ 1 - 1
panda/src/pipeline/conditionVarImpl.h

@@ -46,7 +46,7 @@ typedef ConditionVarPosixImpl ConditionVarImpl;
 
 
 typedef ConditionVarImpl ConditionVarFullImpl;
 typedef ConditionVarImpl ConditionVarFullImpl;
 
 
-#if defined(WIN32_VC)
+#ifdef _WIN32
 #include "conditionVarWin32Impl.h"
 #include "conditionVarWin32Impl.h"
 typedef ConditionVarWin32Impl TrueConditionVarImpl;
 typedef ConditionVarWin32Impl TrueConditionVarImpl;
 
 

+ 2 - 2
panda/src/pipeline/conditionVarWin32Impl.cxx

@@ -13,8 +13,8 @@
 
 
 #include "selectThreadImpl.h"
 #include "selectThreadImpl.h"
 
 
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
 
 
 #include "conditionVarWin32Impl.h"
 #include "conditionVarWin32Impl.h"
 
 
-#endif  // WIN32_VC
+#endif  // _WIN32

+ 2 - 2
panda/src/pipeline/conditionVarWin32Impl.h

@@ -17,7 +17,7 @@
 #include "pandabase.h"
 #include "pandabase.h"
 #include "selectThreadImpl.h"
 #include "selectThreadImpl.h"
 
 
-#if defined(WIN32_VC)
+#ifdef _WIN32
 
 
 #include "mutexWin32Impl.h"
 #include "mutexWin32Impl.h"
 #include "pnotify.h"
 #include "pnotify.h"
@@ -44,6 +44,6 @@ private:
 
 
 #include "conditionVarWin32Impl.I"
 #include "conditionVarWin32Impl.I"
 
 
-#endif  // WIN32_VC
+#endif  // _WIN32
 
 
 #endif
 #endif

+ 3 - 3
panda/src/pipeline/test_delete.cxx

@@ -29,7 +29,7 @@ static const int max_doobers_per_chunk = 1000;
 // The number of threads to spawn.
 // The number of threads to spawn.
 static const int number_of_threads = 4;
 static const int number_of_threads = 4;
 
 
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
 static int last_rand = 0;
 static int last_rand = 0;
 #endif /* __WIN32__ */
 #endif /* __WIN32__ */
 
 
@@ -39,7 +39,7 @@ static double
 random_f(double max) {
 random_f(double max) {
   MutexHolder l(rand_mutex);
   MutexHolder l(rand_mutex);
   int i = rand();
   int i = rand();
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
   last_rand = i;
   last_rand = i;
 #endif /* __WIN32__ */
 #endif /* __WIN32__ */
   return max * (double)i / (double)RAND_MAX;
   return max * (double)i / (double)RAND_MAX;
@@ -88,7 +88,7 @@ public:
   thread_main() {
   thread_main() {
     OUTPUT(nout << *this << " beginning.\n");
     OUTPUT(nout << *this << " beginning.\n");
 
 
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
     rand_mutex.acquire();
     rand_mutex.acquire();
     srand(last_rand);
     srand(last_rand);
     rand_mutex.release();
     rand_mutex.release();

+ 3 - 3
panda/src/pipeline/test_diners.cxx

@@ -26,7 +26,7 @@
 
 
 using std::cerr;
 using std::cerr;
 
 
-#ifdef WIN32_VC
+#ifdef _WIN32
 // Under Windows, the rand() function seems to return a sequence per-thread,
 // Under Windows, the rand() function seems to return a sequence per-thread,
 // so we use this trick to set each thread to a different seed.
 // so we use this trick to set each thread to a different seed.
 static int last_rand = 0;
 static int last_rand = 0;
@@ -38,7 +38,7 @@ static double random_f(double max)
 {
 {
   MutexHolder l(rand_mutex);
   MutexHolder l(rand_mutex);
   int i = rand();
   int i = rand();
-#ifdef WIN32_VC
+#ifdef _WIN32
   last_rand = i;
   last_rand = i;
 #endif /* __WIN32__ */
 #endif /* __WIN32__ */
   return max * (double)i / (double)RAND_MAX;
   return max * (double)i / (double)RAND_MAX;
@@ -76,7 +76,7 @@ class philosopher : public Thread {
 private:
 private:
   int _id;
   int _id;
   void thread_main() {
   void thread_main() {
-#ifdef WIN32_VC
+#ifdef _WIN32
     rand_mutex.acquire();
     rand_mutex.acquire();
     srand(last_rand);
     srand(last_rand);
     rand_mutex.release();
     rand_mutex.release();

+ 2 - 2
panda/src/pipeline/threadDummyImpl.I

@@ -101,14 +101,14 @@ is_simple_threads() {
  */
  */
 INLINE void ThreadDummyImpl::
 INLINE void ThreadDummyImpl::
 sleep(double seconds) {
 sleep(double seconds) {
-#ifdef WIN32
+#ifdef _WIN32
   Sleep((int)(seconds * 1000));
   Sleep((int)(seconds * 1000));
 #else
 #else
   struct timespec rqtp;
   struct timespec rqtp;
   rqtp.tv_sec = time_t(seconds);
   rqtp.tv_sec = time_t(seconds);
   rqtp.tv_nsec = long((seconds - (double)rqtp.tv_sec) * 1000000000.0);
   rqtp.tv_nsec = long((seconds - (double)rqtp.tv_sec) * 1000000000.0);
   nanosleep(&rqtp, nullptr);
   nanosleep(&rqtp, nullptr);
-#endif  // WIN32
+#endif  // _WIN32
 }
 }
 
 
 /**
 /**

+ 1 - 1
panda/src/pipeline/threadDummyImpl.cxx

@@ -32,7 +32,7 @@ std::string ThreadDummyImpl::
 get_unique_id() const {
 get_unique_id() const {
   // In a single-threaded application, this is just the unique process ID.
   // In a single-threaded application, this is just the unique process ID.
   std::ostringstream strm;
   std::ostringstream strm;
-#ifdef WIN32
+#ifdef _WIN32
   strm << GetCurrentProcessId();
   strm << GetCurrentProcessId();
 #else
 #else
   strm << getpid();
   strm << getpid();

+ 1 - 1
panda/src/pipeline/threadDummyImpl.h

@@ -24,7 +24,7 @@
 
 
 class Thread;
 class Thread;
 
 
-#ifdef WIN32
+#ifdef _WIN32
 #ifndef WIN32_LEAN_AND_MEAN
 #ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN 1
 #define WIN32_LEAN_AND_MEAN 1
 #endif
 #endif

+ 2 - 10
panda/src/pnmimage/pnmimage_base.cxx

@@ -33,12 +33,8 @@ pm_message(const char *format, ...) {
 
 
   static const size_t buffer_size = 1024;
   static const size_t buffer_size = 1024;
   char buffer[buffer_size];
   char buffer[buffer_size];
-#if defined(WIN32_VC) || defined(WIN64_VC)
-  // Windows doesn't define vsnprintf().  Hope we don't overflow.
-  vsprintf(buffer, format, ap);
-#else
+
   vsnprintf(buffer, buffer_size, format, ap);
   vsnprintf(buffer, buffer_size, format, ap);
-#endif
   nassertv(strlen(buffer) < buffer_size);
   nassertv(strlen(buffer) < buffer_size);
 
 
   pnmimage_cat.info() << buffer << "\n";
   pnmimage_cat.info() << buffer << "\n";
@@ -57,12 +53,8 @@ pm_error(const char *format, ...) {
 
 
   static const size_t buffer_size = 1024;
   static const size_t buffer_size = 1024;
   char buffer[buffer_size];
   char buffer[buffer_size];
-#if defined(WIN32_VC) || defined(WIN64_VC)
-  // Windows doesn't define vsnprintf().  Hope we don't overflow.
-  vsprintf(buffer, format, ap);
-#else
+
   vsnprintf(buffer, buffer_size, format, ap);
   vsnprintf(buffer, buffer_size, format, ap);
-#endif
   nassertv(strlen(buffer) < buffer_size);
   nassertv(strlen(buffer) < buffer_size);
 
 
   pnmimage_cat.error() << buffer << "\n";
   pnmimage_cat.error() << buffer << "\n";

+ 3 - 3
panda/src/pnmimagetypes/colrops.c

@@ -1,5 +1,5 @@
 /* Filename: colrops.c
 /* Filename: colrops.c
- * Created by:  
+ * Created by:
  *
  *
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  *
  *
@@ -23,7 +23,7 @@
 #endif
 #endif
 
 
 #define bmalloc malloc
 #define bmalloc malloc
-#if !defined(WIN32_VC) && !defined(WIN64_VC)
+#ifndef _WIN32
 extern char     *bmalloc(int);
 extern char     *bmalloc(int);
 #else
 #else
 #include <malloc.h>
 #include <malloc.h>
@@ -37,7 +37,7 @@ static BYTE     *g_mant = NULL, *g_nexp = NULL;
 static BYTE     (*g_bval)[256] = NULL;
 static BYTE     (*g_bval)[256] = NULL;
 
 
 #ifndef pow
 #ifndef pow
-#if !defined(WIN32_VC) && !defined(WIN64_VC)
+#ifndef _WIN32
 extern double   pow(double, double);
 extern double   pow(double, double);
 #endif
 #endif
 #endif
 #endif

+ 0 - 8
panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx

@@ -1215,11 +1215,7 @@ void PNMFileTypeTIFF::
 tiff_warning(const char *, const char *format, va_list ap) {
 tiff_warning(const char *, const char *format, va_list ap) {
   static const int buffer_size = 1024;
   static const int buffer_size = 1024;
   char buffer[buffer_size];
   char buffer[buffer_size];
-#if defined(WIN32_VC) || defined(WIN64_VC)
-  vsprintf(buffer, format, ap);
-#else
   vsnprintf(buffer, buffer_size, format, ap);
   vsnprintf(buffer, buffer_size, format, ap);
-#endif
 
 
   // We ignore the module.  It seems generally useless to us.
   // We ignore the module.  It seems generally useless to us.
   pnmimage_tiff_cat.warning()
   pnmimage_tiff_cat.warning()
@@ -1234,11 +1230,7 @@ void PNMFileTypeTIFF::
 tiff_error(const char *module, const char *format, va_list ap) {
 tiff_error(const char *module, const char *format, va_list ap) {
   static const int buffer_size = 1024;
   static const int buffer_size = 1024;
   char buffer[buffer_size];
   char buffer[buffer_size];
-#if defined(WIN32_VC) || defined(WIN64_VC)
-  vsprintf(buffer, format, ap);
-#else
   vsnprintf(buffer, buffer_size, format, ap);
   vsnprintf(buffer, buffer_size, format, ap);
-#endif
 
 
   // We ignore the module.  It seems generally useless to us.
   // We ignore the module.  It seems generally useless to us.
   pnmimage_tiff_cat.error()
   pnmimage_tiff_cat.error()

+ 1 - 1
panda/src/pstatclient/pStatClientImpl.cxx

@@ -27,7 +27,7 @@
 
 
 #include <algorithm>
 #include <algorithm>
 
 
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
 #include <Winsock2.h>
 #include <Winsock2.h>
 #include <windows.h>
 #include <windows.h>
 #endif
 #endif

+ 2 - 2
panda/src/speedtree/speedTreeNode.cxx

@@ -108,7 +108,7 @@ SpeedTreeNode(const string &name) :
 
 
   _os_shaders_dir = shaders_dir.to_os_specific();
   _os_shaders_dir = shaders_dir.to_os_specific();
   // Ensure the path ends with a terminal slash; SpeedTree requires this.
   // Ensure the path ends with a terminal slash; SpeedTree requires this.
-#if defined(WIN32) || defined(WIN64)
+#ifdef _WIN32
   if (!_os_shaders_dir.empty() && _os_shaders_dir[_os_shaders_dir.length() - 1] != '\\') {
   if (!_os_shaders_dir.empty() && _os_shaders_dir[_os_shaders_dir.length() - 1] != '\\') {
     _os_shaders_dir += "\\";
     _os_shaders_dir += "\\";
   }
   }
@@ -1560,7 +1560,7 @@ setup_for_render(GraphicsStateGuardian *gsg) {
         os_textures_dir = speedtree_textures_dir.get_value().to_os_specific();
         os_textures_dir = speedtree_textures_dir.get_value().to_os_specific();
         // Ensure the path ends with a terminal slash; SpeedTree requires
         // Ensure the path ends with a terminal slash; SpeedTree requires
         // this.
         // this.
-#if defined(WIN32) || defined(WIN64)
+#ifdef _WIN32
         if (!os_textures_dir.empty() && os_textures_dir[os_textures_dir.length() - 1] != '\\') {
         if (!os_textures_dir.empty() && os_textures_dir[os_textures_dir.length() - 1] != '\\') {
           os_textures_dir += "\\";
           os_textures_dir += "\\";
         }
         }

+ 2 - 2
panda/src/tinydisplay/config_tinydisplay.cxx

@@ -87,7 +87,7 @@ init_libtinydisplay() {
   ps->set_system_tag("TinyPanda", "native_window_system", "X11");
   ps->set_system_tag("TinyPanda", "native_window_system", "X11");
 #endif
 #endif
 
 
-#ifdef WIN32
+#ifdef _WIN32
   TinyWinGraphicsPipe::init_type();
   TinyWinGraphicsPipe::init_type();
   TinyWinGraphicsWindow::init_type();
   TinyWinGraphicsWindow::init_type();
   selection->add_pipe_type(TinyWinGraphicsPipe::get_class_type(),
   selection->add_pipe_type(TinyWinGraphicsPipe::get_class_type(),
@@ -116,7 +116,7 @@ init_libtinydisplay() {
 int
 int
 get_pipe_type_p3tinydisplay() {
 get_pipe_type_p3tinydisplay() {
 
 
-#ifdef WIN32
+#ifdef _WIN32
   return TinyWinGraphicsPipe::get_class_type().get_index();
   return TinyWinGraphicsPipe::get_class_type().get_index();
 #endif
 #endif
 
 

+ 1 - 1
panda/src/tinydisplay/tinyWinGraphicsPipe.cxx

@@ -13,7 +13,7 @@
 
 
 #include "pandabase.h"
 #include "pandabase.h"
 
 
-#ifdef WIN32
+#ifdef _WIN32
 
 
 #include "tinyWinGraphicsPipe.h"
 #include "tinyWinGraphicsPipe.h"
 #include "config_tinydisplay.h"
 #include "config_tinydisplay.h"

+ 1 - 1
panda/src/tinydisplay/tinyWinGraphicsPipe.h

@@ -16,7 +16,7 @@
 
 
 #include "pandabase.h"
 #include "pandabase.h"
 
 
-#ifdef WIN32
+#ifdef _WIN32
 
 
 #include "winGraphicsPipe.h"
 #include "winGraphicsPipe.h"
 #include "tinyGraphicsStateGuardian.h"
 #include "tinyGraphicsStateGuardian.h"

+ 1 - 1
panda/src/tinydisplay/tinyWinGraphicsWindow.cxx

@@ -13,7 +13,7 @@
 
 
 #include "pandabase.h"
 #include "pandabase.h"
 
 
-#ifdef WIN32
+#ifdef _WIN32
 
 
 #include "tinyWinGraphicsWindow.h"
 #include "tinyWinGraphicsWindow.h"
 #include "config_tinydisplay.h"
 #include "config_tinydisplay.h"

+ 1 - 1
panda/src/tinydisplay/tinyWinGraphicsWindow.h

@@ -16,7 +16,7 @@
 
 
 #include "pandabase.h"
 #include "pandabase.h"
 
 
-#ifdef WIN32
+#ifdef _WIN32
 
 
 #include "winGraphicsWindow.h"
 #include "winGraphicsWindow.h"
 #include "tinyWinGraphicsPipe.h"
 #include "tinyWinGraphicsPipe.h"

+ 1 - 1
panda/src/tinydisplay/zfeatures.h

@@ -7,7 +7,7 @@
 #define BIG_ENDIAN     4321
 #define BIG_ENDIAN     4321
 
 
 #if (defined(__i386__) || defined(__i386)) || \
 #if (defined(__i386__) || defined(__i386)) || \
-     defined(__ia64__) || defined(WIN32) || \
+     defined(__ia64__) || defined(_WIN32) || \
     (defined(__alpha__) || defined(__alpha)) || \
     (defined(__alpha__) || defined(__alpha)) || \
      defined(__arm__) || \
      defined(__arm__) || \
     (defined(__mips__) && defined(__MIPSEL__)) || \
     (defined(__mips__) && defined(__MIPSEL__)) || \

+ 2 - 2
pandatool/src/maya/mayaApi.cxx

@@ -25,7 +25,7 @@
 #include <maya/MFnAnimCurve.h>
 #include <maya/MFnAnimCurve.h>
 #include "post_maya_include.h"
 #include "post_maya_include.h"
 
 
-#ifdef WIN32_VC
+#ifdef _WIN32
 #include <direct.h>  // for chdir()
 #include <direct.h>  // for chdir()
 #endif
 #endif
 
 
@@ -226,7 +226,7 @@ is_valid() const {
   return _is_valid;
   return _is_valid;
 }
 }
 
 
-#ifdef WIN32
+#ifdef _WIN32
 static string
 static string
 back_to_front_slash(const string &str) {
 back_to_front_slash(const string &str) {
   string result = str;
   string result = str;

+ 2 - 2
pandatool/src/mayaprogs/mayaPview.cxx

@@ -43,11 +43,11 @@
 
 
 // On Windows, we have code to fork pview as a separate process, which seems
 // On Windows, we have code to fork pview as a separate process, which seems
 // to be better for Maya.
 // to be better for Maya.
-#ifdef WIN32_VC
+#ifdef _WIN32
 #include <windows.h>
 #include <windows.h>
 #include <process.h>
 #include <process.h>
 #define SEPARATE_PVIEW 1
 #define SEPARATE_PVIEW 1
-#endif  // WIN32_VC
+#endif  // _WIN32
 
 
 /**
 /**
  *
  *

+ 4 - 4
pandatool/src/mayaprogs/mayaSavePview.cxx

@@ -22,7 +22,7 @@
 
 
 #include <stdlib.h>
 #include <stdlib.h>
 
 
-#ifdef WIN32_VC
+#ifdef _WIN32
 #include <process.h>
 #include <process.h>
 #endif
 #endif
 
 
@@ -69,7 +69,7 @@ doIt(const MArgList &args) {
     pview_args = "-cla";
     pview_args = "-cla";
   }
   }
 
 
-#ifdef WIN32_VC
+#ifdef _WIN32
   // On Windows, we use the spawn function to run pview asynchronously.
   // On Windows, we use the spawn function to run pview asynchronously.
   MString quoted = MString("\"") + filename + MString("\"");
   MString quoted = MString("\"") + filename + MString("\"");
   intptr_t retval = _spawnlp(_P_DETACH, "pview",
   intptr_t retval = _spawnlp(_P_DETACH, "pview",
@@ -78,7 +78,7 @@ doIt(const MArgList &args) {
     return MS::kFailure;
     return MS::kFailure;
   }
   }
 
 
-#else  // WIN32_VC
+#else  // _WIN32
   // On non-Windows (e.g.  Unix), we just use the system function, which runs
   // On non-Windows (e.g.  Unix), we just use the system function, which runs
   // synchronously.  We could fork a process, but no one's asked for this yet.
   // synchronously.  We could fork a process, but no one's asked for this yet.
   MString command = MString("pview " + pview_args + MString(" \"") + filename + MString("\""));
   MString command = MString("pview " + pview_args + MString(" \"") + filename + MString("\""));
@@ -87,7 +87,7 @@ doIt(const MArgList &args) {
   if (command_result != 0) {
   if (command_result != 0) {
     return MS::kFailure;
     return MS::kFailure;
   }
   }
-#endif // WIN32_VC
+#endif // _WIN32
 
 
   return MS::kSuccess;
   return MS::kSuccess;
 }
 }

+ 1 - 1
pandatool/src/mayaprogs/mayaSavePview.h

@@ -71,7 +71,7 @@ public:
 // Since we don't include any of the Panda headers (other than
 // Since we don't include any of the Panda headers (other than
 // dtool_config.h), we have to define this macro ourselves, to tell Windows to
 // dtool_config.h), we have to define this macro ourselves, to tell Windows to
 // export the following functions from the DLL.
 // export the following functions from the DLL.
-#ifdef WIN32_VC
+#ifdef _WIN32
   #define EXPCL_MISC __declspec(dllexport)
   #define EXPCL_MISC __declspec(dllexport)
 #else
 #else
   #define EXPCL_MISC
   #define EXPCL_MISC

+ 2 - 2
pandatool/src/mayaprogs/mayaToEgg_server.cxx

@@ -11,7 +11,7 @@
  * @date 2009-11-09
  * @date 2009-11-09
  */
  */
 
 
-#if defined(WIN32_VC) || defined(WIN64_VC)
+#ifdef _WIN32
 #include <direct.h>  // for chdir
 #include <direct.h>  // for chdir
 #endif
 #endif
 #include "mayaToEgg_server.h"
 #include "mayaToEgg_server.h"
@@ -424,7 +424,7 @@ poll() {
         buffers.push_back(buffer);
         buffers.push_back(buffer);
       }
       }
       // Change to the client's current dir
       // Change to the client's current dir
-#ifdef WIN64_VC
+#ifdef _WIN64
       _chdir(cwd.c_str());
       _chdir(cwd.c_str());
 #else
 #else
       chdir(cwd.c_str());
       chdir(cwd.c_str());

+ 1 - 1
pandatool/src/mayaprogs/mayapath.cxx

@@ -347,7 +347,7 @@ main(int argc, char *argv[]) {
     putenv(putenv_cstr);
     putenv(putenv_cstr);
   }
   }
 
 
-#ifdef WIN32
+#ifdef _WIN32
   string sep = ";";
   string sep = ";";
 #else
 #else
   string sep = ":";
   string sep = ":";

+ 1 - 1
pandatool/src/palettizer/paletteGroups.h

@@ -30,7 +30,7 @@ private:
   typedef pset<PaletteGroup *> Groups;
   typedef pset<PaletteGroup *> Groups;
 
 
 public:
 public:
-#ifndef WIN32_VC
+#ifndef _WIN32
   typedef Groups::const_pointer pointer;
   typedef Groups::const_pointer pointer;
   typedef Groups::const_pointer const_pointer;
   typedef Groups::const_pointer const_pointer;
 #endif
 #endif