/* PyMOL.exe
 * 
 * rc /v pymol.rc
 * cl.exe pymol.cpp /FePyMOL.exe /MD /link python2x.lib pymol.res
 *
 */

#define WIN32_LEAN_AND_MEAN
#include <Python.h>
#include <windows.h>

int PyMOL_Main(int argc, char **argv)
{
    char* code = 
"import sys, os\n"
"sys.frozen = 1\n"
"pymol_path = os.path.dirname(sys.executable)\n"
"os.environ['PYMOL_PATH'] = pymol_path\n"
"os.environ['PATH'] = ';'.join((pymol_path, os.environ['PATH']))\n"
"sys.path.append(os.path.join(sys.prefix, 'Lib', 'site-packages', 'pymol'))\n"
"execfile(os.path.join(sys.prefix, 'Lib', 'site-packages', 'pymol', '__init__.py'))\n";
    Py_Initialize();
    PySys_SetArgv(argc, argv);
    PyRun_SimpleString(code);
    Py_Finalize();
    return 0;
}


int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
    return PyMOL_Main(__argc, __argv);
}

/* Create dependency on msvcp.dll */

#include <iostream>
#include <limits>
#include <math.h>

class Empty {    
    public:
        Empty();

    private:
        double NOTHING;
};

Empty::Empty() {
    NOTHING = std::numeric_limits<double>::infinity();
}
