Explorar o código

support for #ifdef WIN64_VC instead of just #ifdev WIN32_VC alone

Chris Brunner %!s(int64=15) %!d(string=hai) anos
pai
achega
547a72053c
Modificáronse 34 ficheiros con 56 adicións e 53 borrados
  1. 1 1
      panda/src/audio/config_audio.h
  2. 3 3
      panda/src/downloader/bioStreamBuf.cxx
  3. 1 1
      panda/src/downloader/httpChannel.cxx
  4. 2 2
      panda/src/downloader/multiplexStreamBuf.cxx
  5. 1 1
      panda/src/egg/eggGroupNode.h
  6. 1 1
      panda/src/egg/eggPrimitive.h
  7. 4 4
      panda/src/express/error_utils.cxx
  8. 3 3
      panda/src/express/memoryUsage.cxx
  9. 1 1
      panda/src/express/memoryUsage.h
  10. 2 2
      panda/src/express/pointerToArray.I
  11. 4 4
      panda/src/express/pointerToArray.h
  12. 1 1
      panda/src/express/trueClock.cxx
  13. 1 1
      panda/src/express/virtualFileSystem.cxx
  14. 1 1
      panda/src/express/weakPointerToBase.I
  15. 1 1
      panda/src/express/weakPointerToBase.h
  16. 5 2
      panda/src/express/windowsRegistry.cxx
  17. 1 1
      panda/src/glstuff/glpure.cxx
  18. 1 1
      panda/src/grutil/frameRateMeter.cxx
  19. 1 1
      panda/src/grutil/sceneGraphAnalyzerMeter.cxx
  20. 1 1
      panda/src/nativenet/socket_portable.h
  21. 1 1
      panda/src/net/connectionManager.cxx
  22. 2 2
      panda/src/pandabase/pandasymbols.h
  23. 1 1
      panda/src/pgraph/findApproxPath.h
  24. 1 1
      panda/src/pipeline/conditionVarFullWin32Impl.cxx
  25. 1 1
      panda/src/pipeline/conditionVarFullWin32Impl.h
  26. 1 1
      panda/src/pipeline/conditionVarWin32Impl.cxx
  27. 1 1
      panda/src/pipeline/conditionVarWin32Impl.h
  28. 3 3
      panda/src/pipeline/test_delete.cxx
  29. 2 2
      panda/src/pnmimage/pnmimage_base.cxx
  30. 2 2
      panda/src/pnmimagetypes/colrops.c
  31. 2 2
      panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx
  32. 1 1
      panda/src/pstatclient/pStatClientImpl.cxx
  33. 1 1
      panda/src/putil/factoryBase.h
  34. 1 1
      panda/src/vrpn/vrpn_interface.h

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

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

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

@@ -19,7 +19,7 @@
 
 #ifdef HAVE_OPENSSL
 
-#ifdef WIN32_VC
+#if defined(WIN32_VC) || defined(WIN64_VC)
   #include <WinSock2.h>
   #include <windows.h>  // for WSAGetLastError()
   #undef X509_NAME
@@ -183,7 +183,7 @@ underflow() {
         // Immediately save the os error in case we screw up and do
         // something that will change its value before we can output
         // it.
-#ifdef WIN32_VC
+#if defined(WIN32_VC) || defined(WIN64_VC)
         int os_error = WSAGetLastError();
 #else
         int os_error = errno;
@@ -209,7 +209,7 @@ underflow() {
               << "\n";
           }
 
-#ifdef WIN32_VC
+#if defined(WIN32_VC) || defined(WIN64_VC)
           downloader_cat.warning()
             << "Windows error code: " << os_error << "\n";
 #else

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

@@ -27,7 +27,7 @@
 
 #ifdef HAVE_OPENSSL
 
-#ifdef WIN32_VC
+#if defined(WIN32_VC) || defined(WIN64_VC)
   #include <WinSock2.h>
   #include <windows.h>  // for select()
   #undef X509_NAME

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

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

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

@@ -75,7 +75,7 @@ PUBLISHED:
   // except through the limited add_child/remove_child or insert/erase
   // interface.  The following implements this.
 public:
-#ifdef WIN32_VC
+#if defined(WIN32_VC) || defined(WIN64_VC)
   typedef const PT(EggNode) *pointer;
   typedef const PT(EggNode) *const_pointer;
 #else

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

@@ -134,7 +134,7 @@ PUBLISHED:
   // however, except through the limited add_vertex/remove_vertex or
   // insert/erase interface.  The following implements this.
 public:
-#ifdef WIN32_VC
+#if defined(WIN32_VC) || defined(WIN64_VC)
   typedef PT_EggVertex *pointer;
   typedef PT_EggVertex *const_pointer;
 #else

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

@@ -19,7 +19,7 @@
 #include <errno.h>
 #include <stdio.h>
 
-#if defined(WIN32_VC)
+#if defined(WIN32_VC) || defined(WIN64_VC)
   #include <winsock2.h>
 #endif
 
@@ -155,7 +155,7 @@ string error_to_text(ErrorUtilCode err) {
 ////////////////////////////////////////////////////////////////////
 int
 get_write_error() {
-#ifndef WIN32
+#if !defined(WIN32) && !defined(WIN64)
   return EU_error_abort;
 #else
   switch (errno) {
@@ -192,7 +192,7 @@ get_write_error() {
 //  Description:
 ////////////////////////////////////////////////////////////////////
 string handle_socket_error() {
-#ifndef WIN32
+#if !defined(WIN32) && !defined(WIN64)
   return string(strerror(errno));
 #else
   int err = WSAGetLastError();
@@ -252,7 +252,7 @@ string handle_socket_error() {
 ////////////////////////////////////////////////////////////////////
 int
 get_network_error() {
-#ifndef WIN32
+#if !defined(WIN32) && !defined(WIN64)
   return EU_error_abort;
 #else
   int err = WSAGetLastError();

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

@@ -22,7 +22,7 @@
 #include "mutexImpl.h"
 #include "interrogate_request.h"
 
-#if defined(WIN32_VC) && defined(_DEBUG)
+#if (defined(WIN32_VC) || defined (WIN64_VC)) && defined(_DEBUG)
 #include <crtdbg.h>
 #endif
 
@@ -318,7 +318,7 @@ mark_pointer(void *ptr, size_t size, ReferenceCount *ref_ptr) {
   }
 }
 
-#if defined(WIN32_VC) && defined(_DEBUG)
+#if (defined(WIN32_VC) || defined (WIN64_VC))&& defined(_DEBUG)
 ////////////////////////////////////////////////////////////////////
 //     Function: MemoryUsage::win32_malloc_hook
 //       Access: Public, Static
@@ -406,7 +406,7 @@ MemoryUsage(const MemoryHook &copy) : MemoryHook(copy) {
 #error Cannot compile MemoryUsage without malloc wrappers!
 #endif
 
-#if defined(WIN32_VC) && defined(_DEBUG)
+#if (defined(WIN32_VC) || defined(WIN64_VC)) && defined(_DEBUG)
   // On a debug Windows build, we can set this malloc hook which
   // allows tracking every malloc call, even from subordinate
   // libraries.

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

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

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

@@ -376,7 +376,7 @@ erase(iterator first, iterator last) {
   ((To *)(this->_void_ptr))->erase(first, last);
 }
 
-#if !defined(WIN32_VC)
+#if !defined(WIN32_VC) && !defined(WIN64_VC)
 ////////////////////////////////////////////////////////////////////
 //     Function: PointerToArray::Indexing operator
 //       Access: Public
@@ -946,7 +946,7 @@ back() const {
   return ((To *)(this->_void_ptr))->back();
 }
 
-#ifndef WIN32_VC
+#if !defined(WIN32_VC) && !defined(WIN64_VC)
 ////////////////////////////////////////////////////////////////////
 //     Function: ConstPointerToArray::Indexing operator
 //       Access: Public

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

@@ -71,7 +71,7 @@
 #include "py_panda.h"
 #endif
 
-#if defined(WIN32_VC) && !defined(__INTEL_COMPILER)
+#if (defined(WIN32_VC) || defined(WIN64_VC)) && !defined(__INTEL_COMPILER)
 // 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
 #pragma warning (disable : 4506)
@@ -189,7 +189,7 @@ public:
   INLINE void erase(iterator position);
   INLINE void erase(iterator first, iterator last);
 
-#if !defined(WIN32_VC)
+#if !defined(WIN32_VC) && !defined (WIN64_VC)
   INLINE reference operator [](size_type n) const;
   INLINE reference operator [](int n) const;
 #endif
@@ -284,7 +284,7 @@ PUBLISHED:
   typedef TYPENAME pvector<Element>::const_reference const_reference;
   typedef TYPENAME pvector<Element>::const_iterator iterator;
   typedef TYPENAME pvector<Element>::const_iterator const_iterator;
-#ifdef WIN32_VC
+#if defined(WIN32_VC) || defined(WIN64_VC)
   // VC++ seems to break the const_reverse_iterator definition somehow.
   typedef TYPENAME pvector<Element>::reverse_iterator reverse_iterator;
 #else
@@ -317,7 +317,7 @@ PUBLISHED:
   INLINE reference front() const;
   INLINE reference back() const;
 
-#ifndef WIN32_VC
+#if !defined(WIN32_VC) && !defined(WIN64_VC)
   INLINE reference operator [](size_type n) const;
   INLINE reference operator [](int n) const;
 #endif

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

@@ -21,7 +21,7 @@
 
 TrueClock *TrueClock::_global_ptr = NULL;
 
-#ifdef WIN32_VC
+#if defined(WIN32_VC) || defined(WIN64_VC)
 
 ////////////////////////////////////////////////////////////////////
 //

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

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

+ 1 - 1
panda/src/express/weakPointerToBase.I

@@ -125,7 +125,7 @@ reassign(const WeakPointerToBase<To> &copy) {
 }
 
 #ifndef CPPPARSER
-#ifndef WIN32_VC
+#if !defined(WIN32_VC) && !defined(WIN64_VC)
 ////////////////////////////////////////////////////////////////////
 //     Function: WeakPointerToBase::Equivalence operator
 //       Access: Public

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

@@ -48,7 +48,7 @@ public:
   // These comparison functions are common to all things PointerTo, so
   // they're defined up here.
 #ifndef CPPPARSER
-#ifndef WIN32_VC
+#if !defined(WIN32_VC) || !defined(WIN64_VC)
   INLINE bool operator == (const To *other) const;
   INLINE bool operator != (const To *other) const;
   INLINE bool operator > (const To *other) const;

+ 5 - 2
panda/src/express/windowsRegistry.cxx

@@ -16,7 +16,7 @@
 #include "config_express.h"
 #include "textEncoder.h"
 
-#ifdef WIN32_VC
+#if defined(WIN32_VC)
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
@@ -389,4 +389,7 @@ format_message(int error_code) {
   return result;
 }
 
-#endif  // WIN32_VC
+#endif
+
+
+

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

@@ -18,7 +18,7 @@
 // It exists just so we can have some symbols and make the compiler
 // happy.
 
-#if defined(WIN32_VC) && !defined(CPPPARSER) && !defined(LINK_ALL_STATIC)
+#if (defined(WIN32_VC) || defined(WIN64_VC)) && !defined(CPPPARSER) && !defined(LINK_ALL_STATIC)
 __declspec(dllexport)
 #endif
 int glpure;

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

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

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

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

+ 1 - 1
panda/src/nativenet/socket_portable.h

@@ -43,7 +43,7 @@ typedef unsigned long SOCKET;
 /************************************************************************
 * WINSOCK 32 bit STUFF
 ************************************************************************/
-#elif defined(WIN32) || defined(WIN32_VC)
+#elif defined(WIN32) || defined(WIN32_VC) || defined(WIN64_VC)
 #include <winsock2.h>
 #include <Ws2tcpip.h>
 

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

@@ -21,7 +21,7 @@
 #include "lightMutexHolder.h"
 #include "trueClock.h"
 
-#ifdef WIN32_VC
+#if defined(WIN32_VC) || defined(WIN64_VC)
 #include <winsock2.h>  // For gethostname()
 #endif
 

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

@@ -22,7 +22,7 @@
    C++-style comments, since this file is occasionally included by a C
    file. */
 
-#if defined(WIN32_VC) && !defined(CPPPARSER) && !defined(LINK_ALL_STATIC)
+#if (defined(WIN32_VC) || defined(WIN64_VC)) && !defined(CPPPARSER) && !defined(LINK_ALL_STATIC)
 
 #ifdef BUILDING_CFTALK
   #define EXPCL_CFTALK __declspec(dllexport)
@@ -337,7 +337,7 @@
 
 #endif  /* WIN32_VC */
 
-#if defined(WIN32_VC) && !defined(CPPPARSER)
+#if (defined(WIN32_VC) || defined(WIN64_VC)) && !defined(CPPPARSER)
 #define INLINE_LINMATH __forceinline
 #define INLINE_MATHUTIL __forceinline
 

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

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

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

@@ -14,7 +14,7 @@
 
 #include "selectThreadImpl.h"
 
-#ifdef WIN32_VC
+#if defined(WIN32_VC) || defined(WIN64_VC)
 
 #include "conditionVarFullWin32Impl.h"
 

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

@@ -18,7 +18,7 @@
 #include "pandabase.h"
 #include "selectThreadImpl.h"
 
-#ifdef WIN32_VC
+#if defined(WIN32_VC)
 
 #include "mutexWin32Impl.h"
 #include "pnotify.h"

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

@@ -14,7 +14,7 @@
 
 #include "selectThreadImpl.h"
 
-#ifdef WIN32_VC
+#if defined(WIN32_VC) || defined(WIN64_VC)
 
 #include "conditionVarWin32Impl.h"
 

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

@@ -18,7 +18,7 @@
 #include "pandabase.h"
 #include "selectThreadImpl.h"
 
-#ifdef WIN32_VC
+#if defined(WIN32_VC)
 
 #include "mutexWin32Impl.h"
 #include "pnotify.h"

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

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

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

@@ -33,7 +33,7 @@ pm_message(const char *format, ...) {
 
   static const size_t buffer_size = 1024;
   char buffer[buffer_size];
-#ifdef WIN32_VC
+#if defined(WIN32_VC) || defined(WIN64_VC)
   // Windows doesn't define vsnprintf().  Hope we don't overflow.
   vsprintf(buffer, format, ap);
 #else
@@ -59,7 +59,7 @@ pm_error(const char *format, ...) {
 
   static const size_t buffer_size = 1024;
   char buffer[buffer_size];
-#ifdef WIN32_VC
+#if defined(WIN32_VC) || defined(WIN64_VC)
   // Windows doesn't define vsnprintf().  Hope we don't overflow.
   vsprintf(buffer, format, ap);
 #else

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

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

+ 2 - 2
panda/src/pnmimagetypes/pnmFileTypeTIFF.cxx

@@ -1140,7 +1140,7 @@ void PNMFileTypeTIFF::
 tiff_warning(const char *, const char *format, va_list ap) {
   static const int buffer_size = 1024;
   char buffer[buffer_size];
-#ifdef WIN32_VC
+#if defined(WIN32_VC) || defined(WIN64_VC)
   vsprintf(buffer, format, ap);
 #else
   vsnprintf(buffer, buffer_size, format, ap);
@@ -1161,7 +1161,7 @@ void PNMFileTypeTIFF::
 tiff_error(const char *module, const char *format, va_list ap) {
   static const int buffer_size = 1024;
   char buffer[buffer_size];
-#ifdef WIN32_VC
+#if defined(WIN32_VC) || defined(WIN64_VC)
   vsprintf(buffer, format, ap);
 #else
   vsnprintf(buffer, buffer_size, format, ap);

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

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

+ 1 - 1
panda/src/putil/factoryBase.h

@@ -88,7 +88,7 @@ private:
 private:
   // internal mechanics and bookkeeping
 
-#if defined(WIN32_VC) && !defined(__ICL)    //__ICL is Intel C++
+#if (defined(WIN32_VC) || defined(WIN64_VC)) && !defined(__ICL)    //__ICL is Intel C++
   // Visual C++ seems to have a problem with building a map based on
   // BaseCreateFunc.  We'll have to typecast it on the way out.
   typedef pmap<TypeHandle, void *> Creators;

+ 1 - 1
panda/src/vrpn/vrpn_interface.h

@@ -19,7 +19,7 @@
 
 #ifdef CPPPARSER
   // For correct interrogate parsing of UNC's vrpn library.
-  #ifdef WIN32_VC
+  #if defined(WIN32_VC) || defined(WIN64_VC)
     #define _WIN32
     #define SOCKET int
   #else