I wish there was a way to split a #include directive across two lines, so that my code can conform to 80 characters per line, despite the necessity of a very long include path.
Other than expanding the search path of the compiler, how can I manage this? Is there a way to split my very long path string into two lines?
"#define" macro expansion apparently happens after #include expansion, so these don't work:
#define BIGPATH "..."
#include BIGPATH ## "/foo.c"
#include "BIGPATH/foo.c"
#include BIGPATH"/foo.c"
I've also tried
#include "foo" ##
"bar"
and
#include "foo" \
"bar"
To no avail. Perhaps what I want is impossible? Help me, stackoverflow kenobi, you're my only hope.
ANSWER: building on the suggested answer below, here's what actually worked for me:
#define STRINGIFY(x) #x
#define PATH(path) STRINGIFY(/my/very/long/path)
#include PATH(foo.h)
#undef PATH
#undef STRINGIFY
#include SOME_ARG_FROM_USER
(e.g. in Boost.Preprocessor) wouldn't work. – Propitious#include "foo\
(newline, and no preceding whitespace on the next line)bar"
, and post it as a possible answer if it does. – Gnathic