diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/CommandLine.h | 3 | ||||
-rw-r--r-- | src/include/OverloadMacros.h | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/include/CommandLine.h b/src/include/CommandLine.h index 74ff045d..72286863 100644 --- a/src/include/CommandLine.h +++ b/src/include/CommandLine.h @@ -20,11 +20,12 @@ void CCTK_CommandLineDescribeParameter(const char *optarg); void CCTK_CommandLineTestParameters(const char *optarg); void CCTK_CommandLineWarningLevel(const char *optarg); void CCTK_CommandLineErrorLevel(const char *optarg); -void CCTK_CommandLineRedirectStderr(void); +void CCTK_CommandLineRedirectStdout(void); void CCTK_CommandLineListThorns(void); void CCTK_CommandLineVersion(void); void CCTK_CommandLineHelp(void); void CCTK_CommandLineUsage(void); +void CCTK_CommandLineFinished(void); #ifdef __cplusplus } diff --git a/src/include/OverloadMacros.h b/src/include/OverloadMacros.h index dd09bd2c..72c22583 100644 --- a/src/include/OverloadMacros.h +++ b/src/include/OverloadMacros.h @@ -24,16 +24,20 @@ /* This macro defines a global variable with the name of the function * and a function which allows people to set its value. + * + * The function can only be called twice - to set the default, and to overload it. */ #define OVERLOADABLE_FUNCTION(name) \ RETURN_TYPE (*CCTK_##name)(ARGUMENTS) = NULL; \ int CCTK_Overload##name(RETURN_TYPE (*func)(ARGUMENTS)) \ { \ int return_code; \ - if(! CCTK_##name) \ + static int overloaded = 0; \ + if(overloaded < 2) \ { \ CCTK_##name = func; \ - return_code = 1; \ + overloaded++; \ + return_code = overloaded; \ } \ else \ { \ |