File: wrapper.c

package info (click to toggle)
haskell-sdl 0.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 376 kB
  • ctags: 2
  • sloc: haskell: 200; ansic: 18; makefile: 12
file content (25 lines) | stat: -rw-r--r-- 465 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//for explanations see http://www.haskell.org/ghc/docs/latest/html/users_guide/ffi-ghc.html#using-own-main

#include <SDL.h>
#include <HsFFI.h>

#ifdef __GLASGOW_HASKELL__
#include "SDLWrapper_stub.h"
#endif

#ifdef __GLASGOW_HASKELL__
extern void __stginit_SDLWrapper ( void );
#endif

int main(int argc, char *argv[])
{
  hs_init(&argc, &argv);
#ifdef __GLASGOW_HASKELL__
  hs_add_root(__stginit_SDLWrapper);
#endif

  haskell_main();

  hs_exit();
  return 0;
}