From 62217c652e5032e6e5cbf3e485e55d76e68023e8 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 20 Sep 2015 01:37:49 +0200 Subject: [PATCH] Fix various link issues on Windows when building rtdist --- direct/src/plugin/p3dPythonRun.cxx | 6 ++++-- direct/src/stdpy/file.py | 1 + makepanda/makepanda.py | 2 ++ panda/src/downloader/stringStream.I | 4 ++-- panda/src/downloader/stringStream.cxx | 2 +- panda/src/downloader/stringStream.h | 3 ++- panda/src/downloader/stringStreamBuf.I | 4 ++-- panda/src/downloader/stringStreamBuf.h | 8 ++++---- panda/src/downloader/stringStream_ext.cxx | 2 +- panda/src/express/streamReader_ext.h | 1 - 10 files changed, 19 insertions(+), 14 deletions(-) diff --git a/direct/src/plugin/p3dPythonRun.cxx b/direct/src/plugin/p3dPythonRun.cxx index 459d1015ce..3c8e8628c6 100644 --- a/direct/src/plugin/p3dPythonRun.cxx +++ b/direct/src/plugin/p3dPythonRun.cxx @@ -21,8 +21,10 @@ #include "py_panda.h" -// This has been compiled-in by the build system, if all is well. -extern struct _frozen _PyImport_FrozenModules[]; +extern "C" { + // This has been compiled-in by the build system, if all is well. + extern struct _frozen _PyImport_FrozenModules[]; +}; // There is only one P3DPythonRun object in any given process space. // Makes the statics easier to deal with, and we don't need multiple diff --git a/direct/src/stdpy/file.py b/direct/src/stdpy/file.py index c9524e845e..4321a01ed7 100644 --- a/direct/src/stdpy/file.py +++ b/direct/src/stdpy/file.py @@ -14,6 +14,7 @@ import panda3d._core as core import sys import os import io +import encodings _vfs = core.VirtualFileSystem.getGlobalPtr() diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 687aa70510..8e5017d4fa 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -5061,6 +5061,7 @@ if (RTDIST or RUNTIME): TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER']) TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj') + TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj') TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS) TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb') TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll') @@ -5073,6 +5074,7 @@ if (RTDIST or RUNTIME): TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx') TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj') TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj') + TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj') TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS) TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb') TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll') diff --git a/panda/src/downloader/stringStream.I b/panda/src/downloader/stringStream.I index 66481c69ee..5bb892f32f 100644 --- a/panda/src/downloader/stringStream.I +++ b/panda/src/downloader/stringStream.I @@ -63,7 +63,7 @@ get_data_size() { INLINE string StringStream:: get_data() { flush(); - const pvector &data = _buf.get_data(); + const vector_uchar &data = _buf.get_data(); if (!data.empty()) { return string((char *)&data[0], data.size()); } @@ -91,7 +91,7 @@ set_data(const string &data) { // internal buffer. //////////////////////////////////////////////////////////////////// INLINE void StringStream:: -swap_data(pvector &data) { +swap_data(vector_uchar &data) { flush(); _buf.swap_data(data); } diff --git a/panda/src/downloader/stringStream.cxx b/panda/src/downloader/stringStream.cxx index a15172ea08..1a72c17f6a 100644 --- a/panda/src/downloader/stringStream.cxx +++ b/panda/src/downloader/stringStream.cxx @@ -23,7 +23,7 @@ void StringStream:: set_data(const unsigned char *data, size_t size) { _buf.clear(); - pvector pv; + vector_uchar pv; pv.insert(pv.end(), data, data + size); _buf.swap_data(pv); } diff --git a/panda/src/downloader/stringStream.h b/panda/src/downloader/stringStream.h index cc295e5357..158f6194ca 100644 --- a/panda/src/downloader/stringStream.h +++ b/panda/src/downloader/stringStream.h @@ -17,6 +17,7 @@ #include "pandabase.h" #include "stringStreamBuf.h" +#include "vector_uchar.h" #include "extension.h" //////////////////////////////////////////////////////////////////// @@ -49,7 +50,7 @@ public: void set_data(const unsigned char *data, size_t size); #endif - INLINE void swap_data(pvector &data); + INLINE void swap_data(vector_uchar &data); private: StringStreamBuf _buf; diff --git a/panda/src/downloader/stringStreamBuf.I b/panda/src/downloader/stringStreamBuf.I index acd79da1d8..0c0a54bda6 100644 --- a/panda/src/downloader/stringStreamBuf.I +++ b/panda/src/downloader/stringStreamBuf.I @@ -21,7 +21,7 @@ // or the iostream buffer. //////////////////////////////////////////////////////////////////// INLINE void StringStreamBuf:: -swap_data(pvector &data) { +swap_data(vector_uchar &data) { _data.swap(data); } @@ -31,7 +31,7 @@ swap_data(pvector &data) { // Description: Returns a reference to the contents of the internal // buffer, without any of the iostream buffer. //////////////////////////////////////////////////////////////////// -INLINE const pvector &StringStreamBuf:: +INLINE const vector_uchar &StringStreamBuf:: get_data() const { return _data; } diff --git a/panda/src/downloader/stringStreamBuf.h b/panda/src/downloader/stringStreamBuf.h index 2fe5936a2f..ae42cf623d 100644 --- a/panda/src/downloader/stringStreamBuf.h +++ b/panda/src/downloader/stringStreamBuf.h @@ -16,7 +16,7 @@ #define STRINGSTREAMBUF_H #include "pandabase.h" -#include "pvector.h" +#include "vector_uchar.h" //////////////////////////////////////////////////////////////////// // Class : StringStreamBuf @@ -32,8 +32,8 @@ public: void clear(); - INLINE void swap_data(pvector &data); - INLINE const pvector &get_data() const; + INLINE void swap_data(vector_uchar &data); + INLINE const vector_uchar &get_data() const; size_t read_chars(char *start, size_t length); void write_chars(const char *start, size_t length); @@ -47,7 +47,7 @@ protected: virtual int underflow(); private: - pvector _data; + vector_uchar _data; char *_buffer; size_t _ppos; size_t _gpos; diff --git a/panda/src/downloader/stringStream_ext.cxx b/panda/src/downloader/stringStream_ext.cxx index a1c46d6cef..54c889d7e3 100644 --- a/panda/src/downloader/stringStream_ext.cxx +++ b/panda/src/downloader/stringStream_ext.cxx @@ -34,7 +34,7 @@ __init__(PyObject *source) { PyObject *Extension:: get_data() { _this->flush(); - const pvector &data = _this->_buf.get_data(); + const vector_uchar &data = _this->_buf.get_data(); if (!data.empty()) { #if PY_MAJOR_VERSION >= 3 return PyBytes_FromStringAndSize((char *)&data[0], data.size()); diff --git a/panda/src/express/streamReader_ext.h b/panda/src/express/streamReader_ext.h index eb5877f321..49edcd6426 100644 --- a/panda/src/express/streamReader_ext.h +++ b/panda/src/express/streamReader_ext.h @@ -35,7 +35,6 @@ public: BLOCKING PyObject *extract_bytes(size_t size); BLOCKING PyObject *readline(); BLOCKING PyObject *readlines(); - BLOCKING PyObject *get_data() const; }; #endif // HAVE_PYTHON