fix build issues on osx from kaweh kazemi

This commit is contained in:
David Rose 2008-01-17 20:27:43 +00:00
parent 6c007a7fa7
commit 4fd2a6ba3c
12 changed files with 57 additions and 7 deletions

View File

@ -762,7 +762,7 @@ pack_object(PyObject *object) {
pack_int64(PyLong_AsLongLong(object));
} else if (PyString_Check(object) || PyUnicode_Check(object)) {
char *buffer;
int length;
Py_ssize_t length;
PyString_AsStringAndSize(object, &buffer, &length);
if (buffer) {
pack_string(string(buffer, length));

View File

@ -28,6 +28,13 @@
#undef _POSIX_C_SOURCE
#include <Python.h>
// Python 2.5 adds Py_ssize_t; earlier versions don't have it.
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#endif
// Several interfaces in this module that use Python also require
// these header files, so we might as well pick them up too.
#include "datagram.h"

View File

@ -22,7 +22,7 @@
#define IS_LINUX 1
// What additional flags should we pass to interrogate?
#define SYSTEM_IGATE_FLAGS -D__i386__ -D__const=const -Dvolatile=
#define SYSTEM_IGATE_FLAGS -D__i386__ -D__const=const -Dvolatile -Dmutable
// Is the platform big-endian (like an SGI workstation) or
// little-endian (like a PC)? Define this to the empty string to

View File

@ -25,7 +25,7 @@
#define HAVE_GL 1
// What additional flags should we pass to interrogate?
#define SYSTEM_IGATE_FLAGS -D__FLT_EVAL_METHOD__=0 -D__i386__ -D__const=const -Dvolatile -D__LITTLE_ENDIAN__ -D__inline__=inline -D__GNUC__
#define SYSTEM_IGATE_FLAGS -D__FLT_EVAL_METHOD__=0 -D__i386__ -D__const=const -Dvolatile -Dmutable -D__LITTLE_ENDIAN__ -D__inline__=inline -D__GNUC__
// We don't need worry about defining WORDS_BIGENDIAN (and we
// shouldn't anyway, since ppc and intel are different). We rely on

View File

@ -20,7 +20,7 @@
// *******************************************************************
// What additional flags should we pass to interrogate?
#define SYSTEM_IGATE_FLAGS -longlong __int64 -D_X86_ -DWIN32_VC -D"_declspec(param)=" -D"__declspec(param)=" -D_near -D_far -D__near -D__far -D_WIN32 -D__stdcall -Dvolatile=
#define SYSTEM_IGATE_FLAGS -longlong __int64 -D_X86_ -DWIN32_VC -D"_declspec(param)=" -D"__declspec(param)=" -D_near -D_far -D__near -D__far -D_WIN32 -D__stdcall -Dvolatile -Dmutable
// Additional flags to pass to the Tau instrumentor.
#define TAU_INSTRUMENTOR_FLAGS -DTAU_USE_C_API -DPROFILING_ON -DWIN32_VC -D_WIN32 -D__cdecl= -D__stdcall= -D__fastcall= -D__i386 -D_MSC_VER=1310 -D_W64= -D_INTEGRAL_MAX_BITS=64 --exceptions --late_tiebreaker --no_class_name_injection --no_warnings --restrict --microsoft --new_for_init

View File

@ -748,7 +748,7 @@ Warning: Variable $[upcase $[tree]]_INSTALL is not set!
// Caution! interrogate_ipath might be redefined in the
// Global.platform.pp file.
#defer interrogate_ipath $[install_parser_inc_dir:%=-S%] $[target_ipath:%=-I%] -S/usr/include
#defer interrogate_ipath $[install_parser_inc_dir:%=-S%] $[target_ipath:%=-I%]
#defer interrogate_options \
-DCPPPARSER -D__STDC__=1 -D__cplusplus $[SYSTEM_IGATE_FLAGS] \

View File

@ -15,7 +15,7 @@
rtsp.h rtspcodes.h setjmp.h winsock2.h \
ode/ode.h collision_trimesh.h \
netinet/tcp.h netinet/ip.h \
rfftw.h libtar.h malloc.h
rfftw.h libtar.h malloc.h ucontext.h

View File

@ -52,5 +52,7 @@ typedef long long int64_t;
#define NULL ((void *)0)
typedef int fd_set;
#endif

View File

@ -0,0 +1,19 @@
// Filename: ucontext.h
// Created by: drose (17Jan08)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
//
// To contact the maintainers of this program write to
// panda3d-general@lists.sourceforge.net .
//
////////////////////////////////////////////////////////////////////
typedef int ucontext_t;

View File

@ -81,6 +81,26 @@ typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
#endif // __EDG__
////////////////////////////////////////////////////////////////////

View File

@ -36,7 +36,7 @@ private:
friend struct Socket_Selector;
SOCKET _maxid;
fd_set _the_set;
mutable fd_set _the_set;
};
////////////////////////////////////////////////////////////////////

View File

@ -264,6 +264,8 @@ const int LOCAL_CONNECT_BLOCKING = EINPROGRESS;
#include <arpa/inet.h>
#include <unistd.h>
typedef struct sockaddr_in AddressType;
typedef int SOCKET;
const SOCKET BAD_SOCKET = -1;
inline int DO_SELECT(SOCKET n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,struct timeval *timeout)