From ed975aace68fcd8a433ee4246eb313cab1c2d503 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 17 May 2018 15:14:06 -0700 Subject: thunk: default to static for everything If there comes a time when this is an issue, selector may be added and a separate declaration macro provided. For now, it appears static use is generally the appropriate thing to do. --- thunk.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/thunk.h b/thunk.h index a8138b0..2957f22 100644 --- a/thunk.h +++ b/thunk.h @@ -306,14 +306,14 @@ struct thunk_t { * accepting a (thunk_t *) by simply wrapping the call with THUNK(). */ #define THUNK_DEFINE(_name, ...) \ - int _THUNK_GEN_PROTO(_name, __VA_ARGS__); \ + static int _THUNK_GEN_PROTO(_name, __VA_ARGS__); \ typedef struct __thunk_environment_##_name { \ /* struct for encapsulating the calling environment */ \ thunk_t __thunk; \ _THUNK_GEN_STRUCT (__VA_ARGS__); \ } __thunk_environment_##_name; \ \ - int __thunk_dispatch_##_name(thunk_t *thunk) { \ + static int __thunk_dispatch_##_name(thunk_t *thunk) { \ /* dispatch thunk from associated environment */ \ __thunk_environment_##_name *env; \ int r; \ @@ -329,7 +329,7 @@ struct thunk_t { return r; \ } \ \ - thunk_t * _THUNK_GEN_PROTO(__thunk_instantiate_##_name, __VA_ARGS__) { \ + static thunk_t * _THUNK_GEN_PROTO(__thunk_instantiate_##_name, __VA_ARGS__) {\ /* allocate and populate environment, return it */ \ __thunk_environment_##_name *env; \ \ @@ -342,7 +342,7 @@ struct thunk_t { return &env->__thunk; \ } \ \ - int _THUNK_GEN_PROTO(_name, __VA_ARGS__) + static int _THUNK_GEN_PROTO(_name, __VA_ARGS__) /* Call the appropriate instantiate function which returns an embedded thunk_t, * this is how you prepare the thunks established via THUNK_DEFINE(). */ -- cgit v1.2.1