source: CIVL/examples/fortran/nek5000/core/name.h

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100755
File size: 1.2 KB
Line 
1#ifndef NAME_H
2#define NAME_H
3
4/* establishes some macros to establish
5 * the FORTRAN naming convention
6 default gs_setup, etc.
7 -DUPCASE GS_SETUP, etc.
8 -DUNDERSCORE gs_setup_, etc.
9 * a prefix for all external (non-FORTRAN) function names
10 for example, -DPREFIX=jl_ transforms fail -> jl_fail
11 * a prefix for all external FORTRAN function names
12 for example, -DFPREFIX=jlf_ transforms gs_setup_ -> jlf_gs_setup_
13*/
14
15/* the following macro functions like a##b,
16 but will expand a and/or b if they are themselves macros */
17#define TOKEN_PASTE_(a,b) a##b
18#define TOKEN_PASTE(a,b) TOKEN_PASTE_(a,b)
19
20#ifdef PREFIX
21# define PREFIXED_NAME(x) TOKEN_PASTE(PREFIX,x)
22#else
23# define PREFIXED_NAME(x) x
24#endif
25
26#ifdef FPREFIX
27# define FPREFIXED_NAME(x) TOKEN_PASTE(FPREFIX,x)
28#else
29# define FPREFIXED_NAME(x) x
30#endif
31
32#if defined(UPCASE)
33# define FORTRAN_NAME(low,up) FPREFIXED_NAME(up)
34# define FORTRAN_UNPREFIXED(low,up) up
35#elif defined(UNDERSCORE)
36# define FORTRAN_NAME(low,up) FPREFIXED_NAME(TOKEN_PASTE(low,_))
37# define FORTRAN_UNPREFIXED(low,up) TOKEN_PASTE(low,_)
38#else
39# define FORTRAN_NAME(low,up) FPREFIXED_NAME(low)
40# define FORTRAN_UNPREFIXED(low,up) low
41#endif
42
43#endif
44
Note: See TracBrowser for help on using the repository browser.