Case Insensitive #define

Is it possible to produce a dimensionless #define statement with a preprocessor?

For example, I want to convert any foobar shell to spameggs, i.e.:

FooBar -> spameggs
foobar -> spameggs
fooBar -> spameggs
Foobar -> spameggs
FOOBAR -> spameggs
FOOBAr -> spameggs (an odd possibility I know)
etc

The reason for this is that I want #define some fortran routines to have different names, and they are, of course, case insensitive. Please note that it really doesn't matter to me to maintain a capitalization scheme (which in the last example seems like curious nonsense).

+5
source share
2 answers

, , C- . , ( , - , , ). , define ( , , GCC C/++).

grep foobar, . foobar

  • , .

- - FixFooBar.h, , , .

+4

:

  subroutine name1 (args)
  entry      name2 (args)
  entry      name3 (args)
  ....
  return
  end
-1

All Articles