Skip to content
Snippets Groups Projects
Commit e60e88f0 authored by Olivier Dion's avatar Olivier Dion Committed by Adrien Béraud
Browse files

agent/bindings/bindings.h: Add macros for constant definitions

Change-Id: I8c18baa7f42f06a99e56acba0ce7863f1db28938
parent da270b2a
Branches
Tags
No related merge requests found
......@@ -26,5 +26,15 @@
/* Agent */
#include "utils.h"
#define DEFINE_AND_EXPORT(NAME, VALUE, TYPE) \
do { \
scm_c_define(NAME, TYPE(VALUE)); \
scm_c_export(NAME, NULL); \
} while (0)
#define DEFINE_INT(NAME) DEFINE_AND_EXPORT(#NAME, NAME, scm_from_int)
#define DEFINE_UINT(NAME) DEFINE_AND_EXPORT(#NAME, NAME, scm_from_uint)
#define DEFINE_UINT32(NAME) DEFINE_AND_EXPORT(#NAME, NAME, scm_from_uint32)
extern void define_primitive(const char* name, int req, int opt, int rst, void* func);
extern void install_scheme_primitives();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment