Skip to content
Snippets Groups Projects
Commit 8009e654 authored by Oleg Grenrus's avatar Oleg Grenrus
Browse files

Add forward declarations to ForeignLib tests

parent b4c16c9a
No related branches found
No related tags found
No related merge requests found
#include <stdio.h>
#include <stdbool.h>
/* Forward declarations */
bool myForeignLibInit();
void myForeignLibExit();
void sayHi();
int main()
{
......
#include <stdlib.h>
#include <stdbool.h>
#include "HsFFI.h"
HsBool myForeignLibInit(void){
bool myForeignLibInit(void){
int argc = 2;
char *argv[] = { "+RTS", "-A32m", NULL };
char **pargv = argv;
......@@ -11,7 +12,7 @@ HsBool myForeignLibInit(void){
// do any other initialization here and
// return false if there was a problem
return HS_BOOL_TRUE;
return true;
}
void myForeignLibExit(void){
......
......@@ -20,6 +20,7 @@ foreign-library myforeignlib
other-modules: MyForeignLib.Hello
MyForeignLib.SomeBindings
MyForeignLib.AnotherVal
build-depends: base, my-foreign-lib
hs-source-dirs: src
c-sources: csrc/MyForeignLibWrapper.c
......@@ -34,6 +35,7 @@ foreign-library versionedlib
other-modules: MyForeignLib.Hello
MyForeignLib.SomeBindings
MyForeignLib.AnotherVal
build-depends: base, my-foreign-lib
hs-source-dirs: src
c-sources: csrc/MyForeignLibWrapper.c
......
......@@ -35,7 +35,8 @@ main = setupAndCabalTest . recordMode DoNotRecord $ do
-- Link a C program against the library
_ <- runProgramM gccProgram
[ "-o", "uselib"
[ "-std=c11", "-Wall"
, "-o", "uselib"
, "UseLib.c"
, "-l", "myforeignlib"
, "-L", flibdir installDirs ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment