mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
Rename macro to avoid namespace conflicts.
Change-Id: Iecf00f67dcd6250d6919875cee79a600fccab039
This commit is contained in:
@@ -54,34 +54,34 @@ namespace internal {
|
||||
// N.B.: As the GCC manual states, "[s]ince non-static C++ methods
|
||||
// have an implicit 'this' argument, the arguments of such methods
|
||||
// should be counted from two, not one."
|
||||
#define PRINTF_ATTRIBUTE(string_index, first_to_check) \
|
||||
#define CERES_PRINTF_ATTRIBUTE(string_index, first_to_check) \
|
||||
__attribute__((__format__ (__printf__, string_index, first_to_check)))
|
||||
#define SCANF_ATTRIBUTE(string_index, first_to_check) \
|
||||
#define CERES_SCANF_ATTRIBUTE(string_index, first_to_check) \
|
||||
__attribute__((__format__ (__scanf__, string_index, first_to_check)))
|
||||
#else
|
||||
#define PRINTF_ATTRIBUTE(string_index, first_to_check)
|
||||
#define CERES_PRINTF_ATTRIBUTE(string_index, first_to_check)
|
||||
#endif
|
||||
|
||||
// Return a C++ string.
|
||||
extern string StringPrintf(const char* format, ...)
|
||||
// Tell the compiler to do printf format string checking.
|
||||
PRINTF_ATTRIBUTE(1,2);
|
||||
CERES_PRINTF_ATTRIBUTE(1,2);
|
||||
|
||||
// Store result into a supplied string and return it.
|
||||
extern const string& SStringPrintf(string* dst, const char* format, ...)
|
||||
// Tell the compiler to do printf format string checking.
|
||||
PRINTF_ATTRIBUTE(2,3);
|
||||
CERES_PRINTF_ATTRIBUTE(2,3);
|
||||
|
||||
// Append result to a supplied string.
|
||||
extern void StringAppendF(string* dst, const char* format, ...)
|
||||
// Tell the compiler to do printf format string checking.
|
||||
PRINTF_ATTRIBUTE(2,3);
|
||||
CERES_PRINTF_ATTRIBUTE(2,3);
|
||||
|
||||
// Lower-level routine that takes a va_list and appends to a specified string.
|
||||
// All other routines are just convenience wrappers around it.
|
||||
extern void StringAppendV(string* dst, const char* format, va_list ap);
|
||||
|
||||
#undef PRINTF_ATTRIBUTE
|
||||
#undef CERES_PRINTF_ATTRIBUTE
|
||||
|
||||
} // namespace internal
|
||||
} // namespace ceres
|
||||
|
||||
Reference in New Issue
Block a user