To the best of my knowledge I thought you can only share a #define
in header files or only in the source file it was declared in. Stack overflow answers like these seem to support my belief that defines can only be shared through header files.
In the FFmpeg libavutil v6.0 source code, tx_priv.h uses 3 defines TX_FLOAT
, TX_DOUBLE
, and TX_INT32
. These 3 defines are declared in tx_float.c, tx_double.c, and tx_int32.c respectively. I'm wondering how can tx_priv.h access the defines declared in source files? Shouldn't the default #else
always resolve?
This is mostly in the context of other compilers/build tools than the included make. I want to build FFmpeg but I'm trying to understand this issue.
I was expecting for the file tx_priv.h
to never be able to check if the defines TX_FLOAT
, TX_DOUBLE
, and TX_INT32
are actually ever defined.