Empty
Last active
March 1, 2017 11:28
-
-
Save lierdakil/3e8931bad94d8173e6d62aa64f2226d2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #if !BOOST_PP_IS_ITERATING | |
| #include <boost/preprocessor/iteration/iterate.hpp> | |
| #include <boost/preprocessor/seq/seq.hpp> | |
| #include <boost/preprocessor/seq/size.hpp> | |
| #include <boost/preprocessor/facilities/expand.hpp> | |
| #include <boost/preprocessor/stringize.hpp> | |
| #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PP_SEQ_SIZE(PLUGINS), "plugins_pp.h")) | |
| #include BOOST_PP_ITERATE() | |
| #else | |
| #ifdef PLUGINS_INCLUDE | |
| #include BOOST_PP_STRINGIZE(BOOST_PP_SEQ_ELEM(BOOST_PP_EXPAND(BOOST_PP_DEC(BOOST_PP_ITERATION())), PLUGINS).h) | |
| #else | |
| BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(BOOST_PP_EXPAND(BOOST_PP_DEC(BOOST_PP_ITERATION())), PLUGINS), _init)(); | |
| #endif | |
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define PLUGINS (test1)(test2)(test3) | |
| #include <stdio.h> | |
| #define PLUGINS_INCLUDE | |
| #include "plugins_pp.h" | |
| #undef PLUGINS_INCLUDE | |
| int main() { | |
| #include "plugins_pp.h" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void test1_init() { | |
| printf("test1 init\n"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void test2_init() { | |
| printf("test2 init\n"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void test3_init() { | |
| printf("test3 init\n"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment