Fix various compilation and linker issues across several platforms

This commit is contained in:
rdb 2015-10-07 21:09:35 +02:00
parent a5f340c587
commit 7f7f85794d
6 changed files with 16 additions and 12 deletions

View File

@ -20,8 +20,10 @@
#ifdef HAVE_PYTHON #ifdef HAVE_PYTHON
#undef HAVE_LONG_LONG // NSPR and Python both define this. #define PY_SSIZE_T_CLEAN 1
#undef _POSIX_C_SOURCE #undef _POSIX_C_SOURCE
#undef _XOPEN_SOURCE
#include <Python.h> #include <Python.h>
// Python 2.5 adds Py_ssize_t; earlier versions don't have it. // Python 2.5 adds Py_ssize_t; earlier versions don't have it.

View File

@ -1653,6 +1653,8 @@ def CompileLink(dll, obj, opts):
else: else:
cmd += " -pthread" cmd += " -pthread"
cmd += " -Wl,-allow-multiple-definition"
if LDFLAGS != "": if LDFLAGS != "":
cmd += " " + LDFLAGS cmd += " " + LDFLAGS

View File

@ -985,7 +985,7 @@ clear_cache() {
RenderState *state = (RenderState *)(*ti).p(); RenderState *state = (RenderState *)(*ti).p();
int i; int i;
int cache_size = state->_composition_cache.get_size(); int cache_size = (int)state->_composition_cache.get_size();
for (i = 0; i < cache_size; ++i) { for (i = 0; i < cache_size; ++i) {
if (state->_composition_cache.has_element(i)) { if (state->_composition_cache.has_element(i)) {
const RenderState *result = state->_composition_cache.get_data(i)._result; const RenderState *result = state->_composition_cache.get_data(i)._result;
@ -995,10 +995,10 @@ clear_cache() {
} }
} }
} }
_cache_stats.add_total_size(-state->_composition_cache.get_num_entries()); _cache_stats.add_total_size(-(int)state->_composition_cache.get_num_entries());
state->_composition_cache.clear(); state->_composition_cache.clear();
cache_size = state->_invert_composition_cache.get_size(); cache_size = (int)state->_invert_composition_cache.get_size();
for (i = 0; i < cache_size; ++i) { for (i = 0; i < cache_size; ++i) {
if (state->_invert_composition_cache.has_element(i)) { if (state->_invert_composition_cache.has_element(i)) {
const RenderState *result = state->_invert_composition_cache.get_data(i)._result; const RenderState *result = state->_invert_composition_cache.get_data(i)._result;
@ -1008,7 +1008,7 @@ clear_cache() {
} }
} }
} }
_cache_stats.add_total_size(-state->_invert_composition_cache.get_num_entries()); _cache_stats.add_total_size(-(int)state->_invert_composition_cache.get_num_entries());
state->_invert_composition_cache.clear(); state->_invert_composition_cache.clear();
} }

View File

@ -1174,7 +1174,7 @@ clear_cache() {
TransformState *state = (TransformState *)(*ti).p(); TransformState *state = (TransformState *)(*ti).p();
int i; int i;
int cache_size = state->_composition_cache.get_size(); int cache_size = (int)state->_composition_cache.get_size();
for (i = 0; i < cache_size; ++i) { for (i = 0; i < cache_size; ++i) {
if (state->_composition_cache.has_element(i)) { if (state->_composition_cache.has_element(i)) {
const TransformState *result = state->_composition_cache.get_data(i)._result; const TransformState *result = state->_composition_cache.get_data(i)._result;
@ -1184,7 +1184,7 @@ clear_cache() {
} }
} }
} }
_cache_stats.add_total_size(-state->_composition_cache.get_num_entries()); _cache_stats.add_total_size(-(int)state->_composition_cache.get_num_entries());
state->_composition_cache.clear(); state->_composition_cache.clear();
cache_size = state->_invert_composition_cache.get_size(); cache_size = state->_invert_composition_cache.get_size();
@ -1197,7 +1197,7 @@ clear_cache() {
} }
} }
} }
_cache_stats.add_total_size(-state->_invert_composition_cache.get_num_entries()); _cache_stats.add_total_size(-(int)state->_invert_composition_cache.get_num_entries());
state->_invert_composition_cache.clear(); state->_invert_composition_cache.clear();
} }

View File

@ -575,8 +575,8 @@ output_binary(ostream &out, int spaces_every) const {
if (_highest_bits) { if (_highest_bits) {
out << "...1 "; out << "...1 ";
} }
size_t num_bits = max(get_num_bits(), (size_t)spaces_every); int num_bits = max((int)get_num_bits(), spaces_every);
for (size_t i = num_bits - 1; i >= 0; i--) { for (int i = num_bits - 1; i >= 0; i--) {
if (spaces_every != 0 && ((i % spaces_every) == spaces_every - 1)) { if (spaces_every != 0 && ((i % spaces_every) == spaces_every - 1)) {
out << ' '; out << ' ';
} }

View File

@ -153,6 +153,8 @@ private:
static TypeHandle _type_handle; static TypeHandle _type_handle;
}; };
#include "paramValue.I"
EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL, ParamValue<std::string>); EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL, ParamValue<std::string>);
EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL, ParamValue<std::wstring>); EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL, ParamValue<std::wstring>);
@ -211,8 +213,6 @@ typedef ParamMatrix3f ParamMatrix3;
typedef ParamMatrix4f ParamMatrix4; typedef ParamMatrix4f ParamMatrix4;
#endif #endif
#include "paramValue.I"
// Tell GCC that we'll take care of the instantiation explicitly here. // Tell GCC that we'll take care of the instantiation explicitly here.
#ifdef __GNUC__ #ifdef __GNUC__
#pragma interface #pragma interface