Turns out Windows can't resolve pointers from DLLs at compile time, and
there are a bunch of functions and constants in OpenAL that aren't
defined under Windows, so I commented them out in the spirit of
portability. Here's a patch. I also made a Windows installer of the
package if anyone's interested.


Only in PyOpenAL-0.1.4: .py_openal.c.swp
Only in PyOpenAL-0.1.4: build
Common subdirectories: PyOpenAL-0.1.4/demo and PyOpenAL-0.1.4.old/demo
diff PyOpenAL-0.1.4/py_openal.c PyOpenAL-0.1.4.old/py_openal.c
24,25c24
< /* Windows can't resolve pointers at compile time */
< #define DEFERRED(x) 0
---
> 
30,31c29,30
< // #include <AL/alext.h>
< // #include <AL/alut.h>
---
> #include <AL/alext.h>
> #include <AL/alut.h>
64d62
< /* 
72c70
< } */
---
> }
272,273c270
< /* Not defined under Windows */
< #if 0
---
> 
293c290
< #endif /* 0 */
---
> 
449,450d445
< /* Not defined under Windows */
< #if 0
472d466
< #endif /* 0 */
912c906
<     // void *result;
---
>     void *result;
915c909,916
<     alcProcessContext(PyCObject_AsVoidPtr(arg));
---
>     result = alcProcessContext(PyCObject_AsVoidPtr(arg));
> 
>     if(result == NULL) {
>         Py_INCREF(Py_None); 
>         return Py_None;
>     } else {    
>         return PyCObject_FromVoidPtr(result, NULL);
>     }
930,933c931
<     alcDestroyContext(PyCObject_AsVoidPtr(arg));
<     
<     Py_INCREF(Py_None);
<     return Py_None;
---
>     return PyInt_FromLong((long) alcDestroyContext(PyCObject_AsVoidPtr(arg)));
1039d1036
< /* 
1046c1043
< } */
---
> }
1049d1045
< /*
1054c1050
< } */
---
> }
1057,1058d1052
< /* Linux-specific */
< #if 0
1084d1077
< #endif /* 0 */
1665,1666c1658
<   // PyObject_HEAD_INIT(&PyType_Type)
<   PyObject_HEAD_INIT(NULL)
---
>   PyObject_HEAD_INIT(&PyType_Type)
1683c1675
<   DEFERRED(PyObject_GenericGetAttr),/* tp_getattro */
---
>   PyObject_GenericGetAttr,/* tp_getattro */
1703c1695
<   DEFERRED(PyType_GenericAlloc),/* tp_alloc */
---
>   PyType_GenericAlloc,/* tp_alloc */
1705c1697
<   DEFERRED(_PyObject_Del),/* tp_free */
---
>   _PyObject_Del,/* tp_free */
1786c1778
<   alGetSourcei (o->ptr, AL_SOURCE_STATE, &i);
---
>   alGetSourceiv (o->ptr, AL_SOURCE_STATE, &i);
1923c1915
<   alGetSourcei (o->ptr, AL_SOURCE_RELATIVE, &b);
---
>   alGetSourceiv (o->ptr, AL_SOURCE_RELATIVE, &b);
1937c1929
<   alGetSourcei (o->ptr, AL_LOOPING, &b);
---
>   alGetSourceiv (o->ptr, AL_LOOPING, &b);
2081,2082c2073
<   //PyObject_HEAD_INIT(&PyType_Type)
<   PyObject_HEAD_INIT(NULL)
---
>   PyObject_HEAD_INIT(&PyType_Type)
2099c2090
<   DEFERRED(PyObject_GenericGetAttr),/* tp_getattro */
---
>   PyObject_GenericGetAttr,/* tp_getattro */
2119c2110
<   DEFERRED(PyType_GenericAlloc),/* tp_alloc */
---
>   PyType_GenericAlloc,/* tp_alloc */
2121c2112
<   DEFERRED(_PyObject_Del),/* tp_free */
---
>   _PyObject_Del,/* tp_free */
2177,2178c2168
<   // PyObject_HEAD_INIT(&PyType_Type)
<   PyObject_HEAD_INIT(NULL)
---
>   PyObject_HEAD_INIT(&PyType_Type)
2195c2185
<   DEFERRED(PyObject_GenericGetAttr),/* tp_getattro */
---
>   PyObject_GenericGetAttr,/* tp_getattro */
2215c2205
<   DEFERRED(PyType_GenericAlloc),/* tp_alloc */
---
>   PyType_GenericAlloc,/* tp_alloc */
2217c2207
<   DEFERRED(_PyObject_Del),/* tp_free */
---
>   _PyObject_Del,/* tp_free */
2232c2222
<        // { (char *)"alHint", (PyCFunction) _wrap_alHint, METH_VARARGS },
---
>        { (char *)"alHint", (PyCFunction) _wrap_alHint, METH_VARARGS },
2245c2235
<        /* { (char *)"alGetListeneriv", (PyCFunction) _wrap_alGetListeneriv, 
METH_VARARGS }, */
---
>        { (char *)"alGetListeneriv", (PyCFunction) _wrap_alGetListeneriv, 
> METH_VARARGS },
2254c2244
<        /* { (char *)"alGetSourceiv", (PyCFunction) _wrap_alGetSourceiv, 
METH_VARARGS }, */
---
>        { (char *)"alGetSourceiv", (PyCFunction) _wrap_alGetSourceiv, 
> METH_VARARGS },
2295,2297c2285,2287
<        // { (char *)"alutInit", (PyCFunction) _wrap_alutInit, METH_VARARGS },
<        // { (char *)"alutExit", (PyCFunction) _wrap_alutExit, METH_NOARGS },
<        // { (char *)"alutLoadWAV", (PyCFunction) _wrap_alutLoadWAV, 
METH_VARARGS },
---
>        { (char *)"alutInit", (PyCFunction) _wrap_alutInit, METH_VARARGS },
>        { (char *)"alutExit", (PyCFunction) _wrap_alutExit, METH_NOARGS },
>        { (char *)"alutLoadWAV", (PyCFunction) _wrap_alutLoadWAV, METH_VARARGS 
> },
2326,2338d2315
<     PyALListener_Type.tp_getattro = PyObject_GenericGetAttr;
<     PyALListener_Type.tp_alloc = PyType_GenericAlloc;
<     PyALListener_Type.tp_free = _PyObject_Del;
< 
<     PyALSource_Type.tp_getattro = PyObject_GenericGetAttr;
<     PyALSource_Type.tp_alloc = PyType_GenericAlloc;
<     PyALSource_Type.tp_free = _PyObject_Del;
<     
<     PyALBuffer_Type.tp_getattro = PyObject_GenericGetAttr;
<     PyALBuffer_Type.tp_alloc = PyType_GenericAlloc;
<     PyALBuffer_Type.tp_free = _PyObject_Del;
< 
< 
2362c2339
<     /* PyModule_AddIntConstant(m, "AL_STREAMING", AL_STREAMING); */
---
>     PyModule_AddIntConstant(m, "AL_STREAMING", AL_STREAMING);
2365c2342
<     /* PyModule_AddIntConstant(m, "AL_BYTE_LOKI", AL_BYTE_LOKI); */
---
>     PyModule_AddIntConstant(m, "AL_BYTE_LOKI", AL_BYTE_LOKI);
2401c2378
<     /* PyModule_AddIntConstant(m, "AL_DISTANCE_SCALE", AL_DISTANCE_SCALE); */
---
>     PyModule_AddIntConstant(m, "AL_DISTANCE_SCALE", AL_DISTANCE_SCALE);
2405c2382
<     /* PyModule_AddIntConstant(m, "AL_ENV_ROOM_IASIG", AL_ENV_ROOM_IASIG);
---
>     PyModule_AddIntConstant(m, "AL_ENV_ROOM_IASIG", AL_ENV_ROOM_IASIG);
2416c2393
<     PyModule_AddIntConstant(m, "AL_ENV_HIGH_FREQUENCY_REFERENCE_IASIG", 
AL_ENV_HIGH_FREQUENCY_REFERENCE_IASIG); */
---
>     PyModule_AddIntConstant(m, "AL_ENV_HIGH_FREQUENCY_REFERENCE_IASIG", 
> AL_ENV_HIGH_FREQUENCY_REFERENCE_IASIG);

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to