#9140 closed Bugs (fixed)
Building boost::log's snprintf.hpp in Sun Studio 12.3: some functions aren't defined that are expected
Reported by: | Owned by: | Andrey Semashev | |
---|---|---|---|
Milestone: | To Be Determined | Component: | log |
Version: | Boost 1.54.0 | Severity: | Problem |
Keywords: | Cc: | phantall+boost@… |
Description
I get the following error building with Sun Studio 12.3:
"./boost/log/detail/snprintf.hpp", line 40: snprintf is not defined. "./boost/log/detail/snprintf.hpp", line 41: vsnprintf is not defined. "./boost/log/detail/snprintf.hpp", line 44: swprintf is not defined. "./boost/log/detail/snprintf.hpp", line 45: vswprintf is not defined.
Changes needed are something along the lines of:
#if defined( __SUNPRO_CC ) #include <stdio.h> #else #include <cstdio> #endif
... and
#if defined( __SUNPRO_CC ) using std::swprintf; using std::vswprintf; #else using ::swprintf; using ::vswprintf; #endif
Change History (7)
comment:1 by , 9 years ago
comment:3 by , 9 years ago
I just tried the suggested fix and I'm still seeing errors indicating that snprintf / vsnprintf are not defined.
comment:4 by , 9 years ago
ack. my apologies, I'm experimenting with getting boost::asio to build and have -D_XOPEN_SOURCE=1
in my command-line args ... there's some odd stuff going on with that.
comment:5 by , 9 years ago
Cc: | added |
---|
comment:7 by , 9 years ago
I should've made that more clear. Yes, I applied the changes you made and the problem gets resolved.
Note:
See TracTickets
for help on using tickets.
The compiler has non-compliant standard headers. This issue can be worked around by Boost.Compatibility.