//separate compiland #define PERL_NO_GET_CONTEXT #include #include #include __declspec(dllexport) int no_cxt(){ dTHX; return ((int) my_perl) >> 1; } __declspec(dllexport) int cxt(pTHX){ return ((int) my_perl) >> 1; } __declspec(dllexport) int no_cxt_no_glr(){ void *my_perl = TlsGetValue(PL_thr_key); return ((int) my_perl) >> 1; }