The macro in the header:
#define eval CRYPTO_NAMESPACE(eval)
Replaces every token eval with CRYPTO_NAMESPACE(eval). So if the code contains
void eval(char *expr) { ...
the preprocessor output - without any other definition - would be
void CRYPTO_NAMESPACE(eval)(char *expr) { ...
The -D parameters effectively add two more definitions:
#define DCRYPTO_NAMESPACE(x) x #define _CRYPTO_NAMESPACE(x) _##x
In our example, the first define causes the normal result to be re-written one more time:
void eval(char *expr) { ...
so we're back where we started. A different definition could be used to change the compiled name of the function. This definition makes the header definition a no-op.
The second macro uses the token concatenation operator ##. It adds a prefix underscore _ to the macro argument. E.g. if the code contained something like:
void _CRYPTO_NAMESPACE(foo)(int x) {
then the result is
void _foo(int x) {
At a higher level, these macros allow names of things (in the first case anything named eval and in the second, any name at all) to be transformed uniformly throughout the program. This is a fairly standard workaround for name collisions in big C programs. If you have two source code bases that have both defined the same public function name, macros like this can be used to add a prefix or suffix that changes one or both names in the compiled code without modifying either original code. This is an important capability for long-term configuration management where manually editing externally furnished code bases isn't a serious option.
A wild guess is that this treatment is given to eval because the likelihood of some other chunk of C also defining a function named eval is extremely high.
root.h:#define eval CRYPTO_NAMESPACE(eval)is very unclear. It is neither makefile syntax nor C syntax. Do you mean to express that the file named "root.h" contains a single line with a#define? Please provide a more carefully represented minimal reproducible example of the different files in your project."-DCRYPTO_NAMESPACE(x)=x" "-D_CRYPTO_NAMESPACE(x)=_##x"? The meaning of-D, the preprocessor syntax and effect of##? Please be more precise about what you want explained. Do you understand the preprocessor effect of#define CRYPTO_NAMESPACE(x) xand#define _CRYPTO_NAMESPACE(x) _##x?