diff options
author | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2003-10-27 15:30:33 +0000 |
---|---|---|
committer | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2003-10-27 15:30:33 +0000 |
commit | 40eee8fdb5507b1ff9020afb36d16dc834133ba3 (patch) | |
tree | 11122a19d8c83ec606c431d838b470b88f6ca317 /lib/sbin/CreateFunctionBindings.pl | |
parent | 7cb1a39a6b61b5b0b2a0ef137b28496324713e1f (diff) |
Change include mechanism for aliased functions in Fortran. One now has to
#include "cctk_Functions.h" and then use the macro
DECLARE_CCTK_FUNCTIONS.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@3439 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/CreateFunctionBindings.pl')
-rw-r--r-- | lib/sbin/CreateFunctionBindings.pl | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/lib/sbin/CreateFunctionBindings.pl b/lib/sbin/CreateFunctionBindings.pl index 4f2966dd..469918d9 100644 --- a/lib/sbin/CreateFunctionBindings.pl +++ b/lib/sbin/CreateFunctionBindings.pl @@ -279,7 +279,7 @@ sub CreateFunctionBindings ### $dataout = &ThornMasterIncludes($function_db); - &WriteFile('include/cctk_FunctionAliases.h',\$dataout); + &WriteFile('include/cctk_Functions.h',\$dataout); ### # Create the prototype header file for all thorns that USE a @@ -1610,11 +1610,17 @@ sub ThornMasterIncludes { push(@data, "#ifdef THORN_IS_$thorn"); push(@data, "#include \"${thorn}_Prototypes.h\""); + push(@data, "#define DECLARE_CCTK_FUNCTIONS DECLARE_\U$thorn\E_FUNCTIONS"); push(@data, '#endif'); push(@data, ''); } } + push(@data, '#ifndef DECLARE_CCTK_FUNCTIONS'); + push(@data, '#define DECLARE_CCTK_FUNCTIONS _DECLARE_CCTK_FUNCTIONS'); + push(@data, '#endif'); + push(@data, ''); + push(@data, '#endif /* _CCTK_FUNCTIONALIASES_H_ */'); push(@data, "\n"); # workaround for perl 5.004_04 to add a trailing newline @@ -1694,6 +1700,30 @@ sub UsesPrototypes push(@data, '#endif /* CCODE */'); push(@data, ''); + push(@data, '#ifdef FCODE'); + + push(@data, "#define DECLARE_\U$thorn\E_FUNCTIONS _DECLARE_CCTK_FUNCTIONS &&\\"); + + foreach my $FunctionKey (sort keys %FunctionList) + { + $Function = $FunctionList{$FunctionKey}; + if ($Function) + { + if ($Function->{"Used"}) + { + push(@data, " external $Function->{\"Name\"} &&\\"); + if ($Function->{"Return Type"} ne 'void') { + push(@data, " $Function->{\"Return Type\"} $Function->{\"Name\"} && \\"); + } + } + } + } + + push(@data, ''); + + push(@data, '#endif /* FCODE */'); + push(@data, ''); + push(@data, '#endif'); push(@data, "\n"); # workaround for perl 5.004_04 to add a trailing newline |