summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-11-04 15:41:08 -0800
committerVito Caputo <vcaputo@pengaru.com>2020-11-04 15:41:08 -0800
commit31dea83f4e5f3e57c3fc05d8ad01a58dc844c2c7 (patch)
tree26676a5facb50a3507ae7b492d79408c3158fb59
parent9274a3718da767a644df883e6a2ea1e58e060180 (diff)
thunk: s/THUNK_DEFINE/THUNK_DEFINE_STATIC/
In preparation for supporting both public and private thunk defines, convert the current assumed-private one to use a _STATIC suffix.
-rw-r--r--example.c4
-rw-r--r--thunk.h6
2 files changed, 7 insertions, 3 deletions
diff --git a/example.c b/example.c
index 5aa5e43..af341c6 100644
--- a/example.c
+++ b/example.c
@@ -4,14 +4,14 @@
#include "thunk.h"
-THUNK_DEFINE(sum, int, a, int, b, int *, res)
+THUNK_DEFINE_STATIC(sum, int, a, int, b, int *, res)
{
*res = a + b;
return 0;
}
-THUNK_DEFINE(mult, int, a, int, b, int, c, int *, res)
+THUNK_DEFINE_STATIC(mult, int, a, int, b, int, c, int *, res)
{
*res = a * b * c;
diff --git a/thunk.h b/thunk.h
index dd80e84..ef868ab 100644
--- a/thunk.h
+++ b/thunk.h
@@ -375,7 +375,11 @@ struct thunk_t {
* wrapped thunk_t. Calls to this function may then be supplied to anything
* accepting a (thunk_t *) by simply wrapping the call with THUNK().
*/
-#define THUNK_DEFINE(_name, ...) \
+
+/* This is the static variant for private everything static placed local to the
+ * function definition, all in one place in one fell swoop.
+ */
+#define THUNK_DEFINE_STATIC(_name, ...) \
static int _THUNK_GEN_PROTO(_name, __VA_ARGS__); \
typedef struct __thunk_environment_##_name { \
/* struct for encapsulating the calling environment */ \
© All Rights Reserved