Skip to content

Instantly share code, notes, and snippets.

@bboozzoo
Last active March 8, 2016 20:19
Show Gist options
  • Save bboozzoo/a7d427a20e1d299d929e to your computer and use it in GitHub Desktop.
Save bboozzoo/a7d427a20e1d299d929e to your computer and use it in GitHub Desktop.
vala missing header
#ifndef __BAR_H__
#define __BAR_H__
enum {
BAR_UP
};
#endif
#ifndef __FOO_H__
#define __FOO_H__
enum {
FOO_UP
};
#endif
// valac -C foo.vala --vapidir . --pkg foo
public static void main() {
var f = Test.Foo.UP;
var b = Test.Bar.UP;
}
namespace Test {
[CCode (cheader_filename = "foo.h", cname = "int", cprefix = "FOO_")]
public enum Foo {
UP
}
[CCode (cheader_filename = "bar.h", cname = "int", cprefix = "BAR_")]
public enum Bar {
UP
}
}
/* foo.c generated by valac 0.30.1, the Vala compiler
* generated from foo.vala, do not modify */
#include <glib.h>
#include <glib-object.h>
#include <foo.h>
void _vala_main (void);
void _vala_main (void) {
int f = 0;
int b = 0;
f = FOO_UP;
b = BAR_UP;
}
int main (int argc, char ** argv) {
#if !GLIB_CHECK_VERSION (2,35,0)
g_type_init ();
#endif
_vala_main ();
return 0;
}
@bboozzoo
Copy link
Author

bboozzoo commented Mar 8, 2016

include <bar.h> is missing from generated-foo.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment