Feature for ecompile - small Preprocessor
Posted: Tue Jul 04, 2006 2:48 pm
Hello,
it would be a fine thing to have at least a few preprocessor commands available in ecompile. (GNU CPP could be adapted, but it would be rather complex and much too large).
Only very few commands would help a lot:
#define VARIABLE [value] ... define a Variable in the Preprocessors namespace and optionally give it a value other than 1 (String or interger number would suffice).
#ifdef VARIABLE
... // Compile this lines only if #ifdef VARIABLE evalues to true.
...
...
#else
... // else compile this lines
...
...
#endif
With this simple commands we could for example have different includes, or could modify an entire code base with the new *.em files, and have it valid for an older version (096) too.
If the preprocessor variables could be replaced at any place in the code, a lot of practical things would be possible.
#ifdef POL_096_1
#define BUFFER 12
#else
#define BUFFER 14
#endif
const BUF_SIZE := BUFFER;
function xyz(x)
...
endfunction
I like eScript, and use it now for years, the only thing missing for me is a preprocessor. It could be written externally, but ecompile has a make function integrated and I think it would be ideally a part of ecompile.
OWHorus
it would be a fine thing to have at least a few preprocessor commands available in ecompile. (GNU CPP could be adapted, but it would be rather complex and much too large).
Only very few commands would help a lot:
#define VARIABLE [value] ... define a Variable in the Preprocessors namespace and optionally give it a value other than 1 (String or interger number would suffice).
#ifdef VARIABLE
... // Compile this lines only if #ifdef VARIABLE evalues to true.
...
...
#else
... // else compile this lines
...
...
#endif
With this simple commands we could for example have different includes, or could modify an entire code base with the new *.em files, and have it valid for an older version (096) too.
If the preprocessor variables could be replaced at any place in the code, a lot of practical things would be possible.
#ifdef POL_096_1
#define BUFFER 12
#else
#define BUFFER 14
#endif
const BUF_SIZE := BUFFER;
function xyz(x)
...
endfunction
I like eScript, and use it now for years, the only thing missing for me is a preprocessor. It could be written externally, but ecompile has a make function integrated and I think it would be ideally a part of ecompile.
OWHorus