[racket] Embedded Racket 5.1.3 on Windows

From: Sergey Khorev (sergey.khorev at gmail.com)
Date: Tue Oct 4 13:19:44 EDT 2011

For some reason even a simple embedding code crashes with access
violation (compiled with MSVC2008: cl -Zi -I H:\Racket-Textual\include
a.cpp H:\Racket-Textual\lib\msvc\libracket3m_8aa8e0.lib)
Are there any extra steps required in this new version?

#define MZ_PRECISE_GC
#define WIN32
#include <schvers.h>
#include <scheme.h>

#if defined(WIN32) && defined(USE_THREAD_LOCAL)
static __declspec(thread) void *tls_space;
#endif

    static int
_main(Scheme_Env *env, int argc, char **argv)
{
    return 0;
}

int main()
{
#if defined(WIN32) && defined(USE_THREAD_LOCAL)
    scheme_register_tls_space(&tls_space, 0);
#endif

    scheme_main_setup(1, _main, 0, NULL);
    return 0;
}


Posted on the users mailing list.