Skip to content

Commit f2bd340

Browse files
committed
Revert changes to getCStd and getCppStd
1 parent 25988a1 commit f2bd340

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

simplecpp.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4026,7 +4026,7 @@ void simplecpp::cleanup(FileDataCache &cache)
40264026
cache.clear();
40274027
}
40284028

4029-
simplecpp::cstd_t simplecpp::getCStd(const std::string &std, cstd_t dflt)
4029+
simplecpp::cstd_t simplecpp::getCStd(const std::string &std)
40304030
{
40314031
if (std == "c90" || std == "c89" || std == "iso9899:1990" || std == "iso9899:199409" || std == "gnu90" || std == "gnu89")
40324032
return C89;
@@ -4040,7 +4040,7 @@ simplecpp::cstd_t simplecpp::getCStd(const std::string &std, cstd_t dflt)
40404040
return C23;
40414041
if (std == "c2y" || std == "gnu2y")
40424042
return C2Y;
4043-
return dflt;
4043+
return CUnknown;
40444044
}
40454045

40464046
const char *simplecpp::getCStdName(cstd_t std)
@@ -4090,7 +4090,7 @@ std::string simplecpp::getCStdString(const std::string &std)
40904090
return getCStdString(getCStd(std));
40914091
}
40924092

4093-
simplecpp::cppstd_t simplecpp::getCppStd(const std::string &std, cppstd_t dflt)
4093+
simplecpp::cppstd_t simplecpp::getCppStd(const std::string &std)
40944094
{
40954095
if (std == "c++98" || std == "c++03" || std == "gnu++98" || std == "gnu++03")
40964096
return CPP03;
@@ -4106,7 +4106,7 @@ simplecpp::cppstd_t simplecpp::getCppStd(const std::string &std, cppstd_t dflt)
41064106
return CPP23;
41074107
if (std == "c++26" || std == "c++2c" || std == "gnu++26" || std == "gnu++2c")
41084108
return CPP26;
4109-
return dflt;
4109+
return CPPUnknown;
41104110
}
41114111

41124112
const char *simplecpp::getCppStdName(cppstd_t std)

simplecpp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,13 +588,13 @@ namespace simplecpp {
588588
SIMPLECPP_LIB std::string convertCygwinToWindowsPath(const std::string &cygwinPath);
589589

590590
/** Returns the C version a given standard */
591-
SIMPLECPP_LIB cstd_t getCStd(const std::string &std, cstd_t dflt = CUnknown);
591+
SIMPLECPP_LIB cstd_t getCStd(const std::string &std);
592592

593593
/** Returns the name of a C standard */
594594
SIMPLECPP_LIB const char *getCStdName(cstd_t std);
595595

596596
/** Returns the C++ version a given standard */
597-
SIMPLECPP_LIB cppstd_t getCppStd(const std::string &std, cppstd_t dflt = CPPUnknown);
597+
SIMPLECPP_LIB cppstd_t getCppStd(const std::string &std);
598598

599599
/** Returns the name of a C++ standard */
600600
SIMPLECPP_LIB const char *getCppStdName(cppstd_t std);

0 commit comments

Comments
 (0)