123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- #ifndef CERES_INTERNAL_STRINGPRINTF_H_
- #define CERES_INTERNAL_STRINGPRINTF_H_
- #include <cstdarg>
- #include <string>
- #include "ceres/internal/disable_warnings.h"
- #include "ceres/internal/export.h"
- namespace ceres::internal {
- #if (defined(__GNUC__) || defined(__clang__))
- #define CERES_PRINTF_ATTRIBUTE(string_index, first_to_check) \
- __attribute__((__format__(__printf__, string_index, first_to_check)))
- #define CERES_SCANF_ATTRIBUTE(string_index, first_to_check) \
- __attribute__((__format__(__scanf__, string_index, first_to_check)))
- #else
- #define CERES_PRINTF_ATTRIBUTE(string_index, first_to_check)
- #endif
- CERES_NO_EXPORT extern std::string StringPrintf(const char* format, ...)
-
- CERES_PRINTF_ATTRIBUTE(1, 2);
- CERES_NO_EXPORT extern const std::string& SStringPrintf(std::string* dst,
- const char* format,
- ...)
-
- CERES_PRINTF_ATTRIBUTE(2, 3);
- CERES_NO_EXPORT extern void StringAppendF(std::string* dst,
- const char* format,
- ...)
-
- CERES_PRINTF_ATTRIBUTE(2, 3);
- CERES_NO_EXPORT extern void StringAppendV(std::string* dst,
- const char* format,
- va_list ap);
- #undef CERES_PRINTF_ATTRIBUTE
- }
- #include "ceres/internal/reenable_warnings.h"
- #endif
|