init.c 473 B

12345678910111213
  1. #include <Python.h>
  2. #include "CPy.h"
  3. struct ExcDummyStruct _CPy_ExcDummyStruct = { PyObject_HEAD_INIT(NULL) };
  4. PyObject *_CPy_ExcDummy = (PyObject *)&_CPy_ExcDummyStruct;
  5. // Because its dynamic linker is more restricted than linux/OS X,
  6. // Windows doesn't allow initializing globals with values from
  7. // other dynamic libraries. This means we need to initialize
  8. // things at load time.
  9. void CPy_Init(void) {
  10. _CPy_ExcDummyStruct.ob_base.ob_type = &PyBaseObject_Type;
  11. }