Length of `stem` without a trailing `_ ` / `- ` / `. ` * platform suffix (the longest one), or `len` when it has none. */
| 1916 | /* Length of `stem` without a trailing `_<token>` / `-<token>` / `.<token>` |
| 1917 | * platform suffix (the longest one), or `len` when it has none. */ |
| 1918 | static size_t platform_stem_len(const char *stem, size_t len) { |
| 1919 | size_t best = len; |
| 1920 | for (size_t sep = 1; sep < len; sep++) { |
| 1921 | char c = stem[sep - 1]; |
| 1922 | if ((c == '_' || c == '-' || c == '.') && platform_token_eq(stem + sep, len - sep)) { |
| 1923 | if (sep - 1 < best) { |
| 1924 | best = sep - 1; |
| 1925 | } |
| 1926 | } |
| 1927 | } |
| 1928 | return best; |
| 1929 | } |
| 1930 | |
| 1931 | static bool c_family_variant_lang(CBMLanguage lang) { |
| 1932 | return lang == CBM_LANG_C || lang == CBM_LANG_CPP || lang == CBM_LANG_CUDA || |
no test coverage detected