
unsigned char file_load_py_test[] = {
#include "include-test.py"
};

unsigned char file_load_py_main[] = {
#include "include-bootstrap.py"
};

//	

//Importing exported functions
//ePyDEFINE is inside namespace
#define ePyDEFINE(return_type, name, ...) \
	FARPROC fp##name; \
	typedef decltype(&name) r##name; \
	r##name name; \

#define ePyIMPORT(lib, name) \
	PythonABI::fp##name = GetProcAddress(lib, #name); \
	if(PythonABI::fp##name == NULL)\
	{\
		BlPrintf("    - Failure to GetProcAddress on %s", #name);\
		return false;\
	}\
	PythonABI::name = ((PythonABI::r##name)PythonABI::fp##name); \


//Importing exported symbols
//sPyDEFINE is inside namespace
#define sPyDEFINE(type, name) \
	FARPROC fp##name; \
	typedef type* r##name; \
	r##name name; \

#define sPyIMPORT(lib, name) \
	PythonABI::fp##name = GetProcAddress(lib, #name); \
	if(PythonABI::fp##name == NULL)\
	{\
		BlPrintf("    - Failure to GetProcAddress on %s", #name);\
		return false;\
	}\
	PythonABI::name = ((PythonABI::r##name)PythonABI::fp##name); \

namespace PythonABI
{
	ePyDEFINE(int, Py_IsInitialized);
	ePyDEFINE(void, Py_InitializeEx, int);

	ePyDEFINE(int, PyRun_SimpleString, const char*);
	ePyDEFINE(int, PyRun_SimpleStringFlags, const char*, PyCompilerFlags*);
	ePyDEFINE(int, PyRun_SimpleFile, FILE*, const char*);
	ePyDEFINE(int, PyRun_SimpleFileEx, FILE*, const char*, int);
	ePyDEFINE(int, PyRun_SimpleFileExFlags, FILE*, const char*, int, int);

	ePyDEFINE(int, Py_FinalizeEx,);

	ePyDEFINE(FILE*, _Py_fopen_obj, PyObject*, const char*);
	//typedef void (*ppSetPathFn)(wchar_t*);

	ePyDEFINE(PyObject*, PyObject_Call, PyObject*, PyObject*, PyObject*);
	ePyDEFINE(PyObject*, PyObject_CallNoArgs, PyObject*);
	ePyDEFINE(PyObject*, PyObject_CallObject, PyObject*, PyObject*);
	ePyDEFINE(PyObject*, PyObject_Bytes, PyObject*);
	ePyDEFINE(int, PyObject_IsTrue, PyObject*);

	ePyDEFINE(int, PyCallable_Check, PyObject*);
	ePyDEFINE(void, PyErr_SetString, PyObject*, const char*);
	ePyDEFINE(void, PyErr_Print);

	ePyDEFINE(int, PyArg_ParseTuple, PyObject*, const char*, ...);
	ePyDEFINE(Py_ssize_t, PyTuple_Size, PyObject*);
	ePyDEFINE(PyObject*, PyTuple_GetItem, PyObject*, Py_ssize_t);

	ePyDEFINE(PyObject*, PyLong_FromSize_t, size_t);
	ePyDEFINE(PyObject*, PyLong_FromSsize_t, Py_ssize_t);
	ePyDEFINE(PyObject*, PyLong_FromLong, long);
	ePyDEFINE(PyObject*, PyLong_FromUnsignedLong, long);
	ePyDEFINE(Py_ssize_t, PyLong_AsSsize_t, PyObject*);
	ePyDEFINE(size_t, PyLong_AsSize_t, PyObject*);

	ePyDEFINE(double, PyFloat_AsDouble, PyObject*);


	ePyDEFINE(PyObject*, PyUnicode_FromString, const char*);
	ePyDEFINE(PyObject*, PyUnicode_AsASCIIString, PyObject*);

	ePyDEFINE(char*, PyBytes_AsString, PyObject*);

	ePyDEFINE(PyObject*, Py_BuildValue, const char*, ...);
	ePyDEFINE(PyObject*, PyList_New, Py_ssize_t len);
	ePyDEFINE(int, PyList_Append, PyObject*, PyObject*);
	ePyDEFINE(PyObject*, PyDict_New);
	ePyDEFINE(PyObject*, PyDict_SetItemString, PyObject*, const char*, PyObject*);

	ePyDEFINE(int, PyArg_UnpackTuple, PyObject*, const char*, Py_ssize_t, Py_ssize_t, ...);
	ePyDEFINE(int, PySequence_Check, PyObject*);
	ePyDEFINE(Py_ssize_t, PySequence_Length, PyObject*);
	ePyDEFINE(PyObject*, PySequence_GetItem, PyObject*, Py_ssize_t);

	ePyDEFINE(int, PyImport_AppendInittab, const char*, PyObject* (*initfunc)(void));
	ePyDEFINE(PyObject*, PyModule_Create2, struct PyModuleDef*, int);
	ePyDEFINE(int, PyModule_AddObject, PyObject*, const char*, PyObject*);

	ePyDEFINE(PyObject*, Py_NewRef, PyObject*);
	ePyDEFINE(void, Py_IncRef, PyObject*);
	ePyDEFINE(void, Py_DecRef, PyObject*);
	ePyDEFINE(PyObject*, PyErr_NewException, char*, PyObject*, PyObject*);
	ePyDEFINE(PyObject*, PyErr_Occurred);
	ePyDEFINE(void, PyErr_Clear);
	ePyDEFINE(void, PyErr_SetNone, PyObject*);

	ePyDEFINE(PyObject*, PyObject_SelfIter, PyObject*);
	ePyDEFINE(int, PyType_Ready, PyTypeObject*);
	ePyDEFINE(PyObject*, PyType_GenericNew, PyTypeObject*, PyObject*, PyObject*);
	ePyDEFINE(PyObject*, PyType_GenericAlloc, PyTypeObject*, Py_ssize_t);

	ePyDEFINE(int, Py_IsNone, PyObject*);

	//exported symbols
	sPyDEFINE(PyObject*, PyExc_TypeError);
	sPyDEFINE(PyObject*, PyExc_ValueError);
	sPyDEFINE(PyObject*, PyExc_RuntimeError);
	sPyDEFINE(PyTypeObject, PyType_Type);
	sPyDEFINE(PyObject*, PyExc_StopIteration);

	sPyDEFINE(void*, PyUnicode_Type);
	sPyDEFINE(void*, PyLong_Type);
	sPyDEFINE(void*, PyFloat_Type);
	sPyDEFINE(void*, PyBool_Type);
}


#define EMPTY(...) (true __VA_OPT__(&& false))

#define mPy_CLEAR(op)                            \
    do {                                        \
        PyObject *_py_tmp = _PyObject_CAST(op); \
        if (_py_tmp != NULL) {                  \
            (op) = NULL;                        \
            ePy_DecRef(_py_tmp);                 \
        }                                       \
    } while (0)

//Macro has same name as API function, causing interference:
#undef Py_IsNone


