Returns whether CPL_DEBUG is enabled. * * @since 3.11 */
| 1960 | * @since 3.11 |
| 1961 | */ |
| 1962 | bool CPLIsDebugEnabled() |
| 1963 | { |
| 1964 | if (gnDebug < 0) |
| 1965 | { |
| 1966 | // Check that apszKnownConfigOptions is correctly sorted with |
| 1967 | // STRCASECMP() criterion. |
| 1968 | for (size_t i = 1; i < CPL_ARRAYSIZE(apszKnownConfigOptions); ++i) |
| 1969 | { |
| 1970 | if (STRCASECMP(apszKnownConfigOptions[i - 1], |
| 1971 | apszKnownConfigOptions[i]) >= 0) |
| 1972 | { |
| 1973 | CPLError(CE_Failure, CPLE_AppDefined, |
| 1974 | "ERROR: apszKnownConfigOptions[] isn't correctly " |
| 1975 | "sorted: %s >= %s", |
| 1976 | apszKnownConfigOptions[i - 1], |
| 1977 | apszKnownConfigOptions[i]); |
| 1978 | } |
| 1979 | } |
| 1980 | gnDebug = CPLTestBool(CPLGetConfigOption("CPL_DEBUG", "OFF")); |
| 1981 | } |
| 1982 | |
| 1983 | return gnDebug != 0; |
| 1984 | } |
| 1985 | |
| 1986 | /************************************************************************/ |
| 1987 | /* CPLDeclareKnownConfigOption() */ |
no test coverage detected