-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
{.experimental: "codeReordering".}
const
headerbass* = "bass.h"
STREAMPROC_DUMMY* = cast[ptr STREAMPROC](0)
{.pragma: impbassHdr, header: headerbass.}
type
DWORD* {.importc, impbassHdr.} = uint32
HSTREAM* {.importc, impbassHdr.} = DWORD
STREAMPROC* {.importc, impbassHdr.} = proc (handle: HSTREAM; buffer: pointer;
length: DWORD; user: pointer): DWORD {.cdecl.}Without codeReordering, this fails because STREAMPROC is defined after the const section which refers to it. Adding codeReordering avoids that but now complains about invalid pragmas.
a.nim(10, 21) Error: invalid pragma: impbassHdr
a.nim(11, 23) Error: invalid pragma: impbassHdr
a.nim(12, 26) Error: invalid pragma: impbassHdr
Remove the pragmas altogether and the issue no longer occurs.
{.experimental: "codeReordering".}
const
STREAMPROC_DUMMY* = cast[ptr STREAMPROC](0)
type
DWORD* {.importc.} = uint32
HSTREAM* {.importc.} = DWORD
STREAMPROC* {.importc.} = proc (handle: HSTREAM; buffer: pointer;
length: DWORD; user: pointer): DWORD {.cdecl.}Metadata
Metadata
Assignees
Labels
No labels