Newer
Older
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{-# LANGUAGE TemplateHaskell #-}
module Glest.Utils.InlineC (
ctx
) where
import Data.Map.Strict as Map
import Glest.Egl.Types
import Language.C.Inline.Context
import Language.C.Types
import Language.Haskell.TH
import Quasar.Prelude
import System.Posix.Types (COff(..))
ctx :: Context
ctx = baseCtx <> extraTypesCtx
emptyCtx :: Context
emptyCtx = Context {
ctxTypesTable = mempty,
ctxAntiQuoters = mempty,
ctxOutput = mempty,
ctxForeignSrcLang = Nothing,
ctxEnableCpp = False
}
extraTypesCtx :: Context
extraTypesCtx =
emptyCtx {
ctxTypesTable = Map.fromList types
}
types :: [(TypeSpecifier, TypeQ)]
types = [
(TypeName "off_t", [t|COff|]),
(TypeName "EGLint", [t|EGLint|]),
(TypeName "EGLBoolean", [t|EGLBoolean|]),
(TypeName "EGLConfig", [t|EGLConfig|]),
(TypeName "EGLContext", [t|EGLContext|]),
(TypeName "EGLDisplay", [t|EGLDisplay|]),
(TypeName "EGLDeviceEXT", [t|EGLDeviceEXT|])
]