I found some really old codes in my company's code base, some of them probabily can be traced back to 30 yrs ago. Within those files, I found some strange .c
files, they looks extremely like pure C codes, except for some macros (?) start with percentage mark, for example,
%IF ( .NOT. WIN32 ) THEN
%INCLUDE (header)
%ENDIF
int func(blablabla...)
....
I believe this syntax comes from Fortran, but every other statements are in legal pure C, even the comments start with /**
and //
. So I wonder what's this C dialect, and how can I compile it nowadays?
Looks like a proprietary preprocessor. It has little to do with being old code, the C preprocessor has never accepted such. It is not possible perhaps to determine the purpose of this preprocessor since what it appears to be used for in this short example is entirely possible in the standard preprocessor.
To build the code you might simply replace all such preprocessor directives with standard ones. But you may have to make some assumptions about the semantics. For example:
#if !defined WIN32
#include "header"
#endif
int func(blablabla...)
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With