Okay, so I had an idea to work around the issue since macros are at least allowed:
Code:
#define INC_3X_H(INC) #INC
#define INC_2X_H(DIR,INC) INC_3X_H(DIR##INC)
#define INC_1X_H(DIR,INC) INC_2X_H(DIR,INC)
#define INC_X_H(INC) INC_1X_H(INC_PAW,INC)
#define MSG_2X_H(MSG) _Pragma(#MSG)
#define MSG_1X_H(MSG) MSG_2X_H(GCC warning #MSG)
#define MSG_X_H(MSG) MSG_1X_H(MSG)
MSG_X_H(INC_X_H(x/...))
#include INC_X_H(x/...)
Currently failing to get output from the pragma but I'll leave that aside for a moment while I address the error that did pop up:
Code:
include/x/...:L:C: error: #include expects "FILENAME" or <FILENAME>
L | #include INC_X_H(x/...)
Edit: Noticed I made a typo, with that fixed and double checking the supported pragma directives for GCC I got this output (irrelevant stuff edited down to just X and x/...):
Code:
cc ... -D INC_X="./include/" ...
In file included from include/x/...:4,
from include/x/...:4,
from .../libx/...:1:
<command-line>: error: pasting "/" and "x" does not give a valid preprocessing token
include/x/...:L:C: note: in definition of macro ‘INC_2X_H’
L | #define INC_2X_H(DIR,INC) INC_3X_H(DIR##INC)
| ^~~
include/x/...:L:C: note: in expansion of macro ‘INC_1X_H’
L | #define INC_X_H(INC) INC_1X_H(INC_X,INC)
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/x/...:L:C: note: in expansion of macro ‘INC_X’
L | #define INC_X_H(INC) INC_1X_H(INC_X,INC)
| ^~~~~~~
include/x/...:L:C: note: in expansion of macro ‘INC_X_H’
L | MSG_X_H(INC_X_H(x/...))
| ^~~~~~~~~~~~~~~~~~~~~~~
include/x/...:L:C: warning: Trying: "./include/x/..."
L | MSG_X_H(INC_X_H(x/...))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<command-line>: error: pasting "/" and "x" does not give a valid preprocessing token
include/x/...:L:C: note: in definition of macro ‘INC_2X_H’
L | #define INC_2X_H(DIR,INC) INC_3X_H(DIR##INC)
| ^~~
include/x/...:L:C: note: in expansion of macro ‘INC_1X_H’
L | #define INC_X_H(INC) INC_1X_H(INC_X,INC)
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/x/...:L:C: note: in expansion of macro ‘INC_X’
L | #define INC_X_H(INC) INC_1X_H(INC_X,INC)
| ^~~~~~~
include/x/...:L:C: note: in expansion of macro ‘INC_X_H’
L | #include INC_X_H(x/...)
| ^~~~~~~~~~~~~~~~~~~~~~~
include/x/...:L:C: fatal error: ./include/x/...: No such file or directory
L | #include INC_X_H(x/...)
| ^
compilation terminated.
...