| 771 | |
| 772 | |
| 773 | std::set<std::string> Preprocessor::getConfigs() const |
| 774 | { |
| 775 | std::set<std::string> ret = { "" }; |
| 776 | if (!mTokens.cfront()) |
| 777 | return ret; |
| 778 | |
| 779 | std::set<std::string> defined = { "__cplusplus" }; |
| 780 | |
| 781 | // Insert library defines |
| 782 | for (const auto &define : mSettings.library.defines()) { |
| 783 | |
| 784 | const std::string::size_type paren = define.find("("); |
| 785 | const std::string::size_type space = define.find(" "); |
| 786 | std::string::size_type end = space; |
| 787 | |
| 788 | if (paren != std::string::npos && paren < space) |
| 789 | end = paren; |
| 790 | |
| 791 | defined.insert(define.substr(0, end)); |
| 792 | } |
| 793 | |
| 794 | ::getConfigs(mTokens, defined, mSettings.userDefines, mSettings.userUndefs, ret); |
| 795 | |
| 796 | for (const auto &filedata : mFileCache) { |
| 797 | if (!mSettings.configurationExcluded(filedata->filename)) |
| 798 | ::getConfigs(filedata->tokens, defined, mSettings.userDefines, mSettings.userUndefs, ret); |
| 799 | } |
| 800 | |
| 801 | return ret; |
| 802 | } |
| 803 | |
| 804 | static void splitcfg(const std::string &cfgStr, std::list<std::string> &defines, const std::string &defaultValue) |
| 805 | { |