id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 3931,Build boost libraries under HP-UX with GNU C/C++,vovata@…,Vladimir Prus,"I tried build boost, with program_options, under HP-UX (B.11.23 U ia64) with GNU C/C++ compiler version 4.3.1, using bjam. I fpund a problem with the define WCHAR_MAX in the system headers of HP-UX, it is defined there with type cast, and an error arrives in the build:[[BR]] In file included from libs/program_options/src/utf8_codecvt_facet.cpp:15: libs/program_options/src/../../detail/utf8_codecvt_facet.cpp:255:7: error: missing binary operator before token ""(""[[BR]] The problematic define is in the system wchar.h:[[BR]] # if defined(_INCLUDE_STDC__SOURCE_199901)[[BR]] # define WCHAR_MAX UINT_MAX /* max value of an unsigned integer */[[BR]] # define WCHAR_MIN 0[[BR]] # else[[BR]] '''# define WCHAR_MAX (wchar_t)UINT_MAX /* max value of an unsigned integer */[[BR]] # define WCHAR_MIN (wchar_t)0'''[[BR]] # endif[[BR]] I fixed the problem with a little modification of libs/detail/utf8_codecvt_facet.cpp, I replaced [[BR]] #if defined(_MSC_VER) && _MSC_VER <= 1310 // 7.1 or earlier[[BR]] return 2;[[BR]] #elif WCHAR_MAX > 0x10000[[BR]] if (word < 0x10000) {[[BR]] return 2;[[BR]] }[[BR]] if (word < 0x200000) {[[BR]] return 3;[[BR]] }[[BR]] if (word < 0x4000000) {[[BR]] return 4;[[BR]] }[[BR]] return 5;[[BR]] #else[[BR]] return 2;[[BR]] #endif[[BR]] with this one[[BR]] #if defined(_MSC_VER) && _MSC_VER <= 1310 // 7.1 or earlier[[BR]] return 2;[[BR]] #else[[BR]] if (WCHAR_MAX > 0x10000) {[[BR]] if (word < 0x10000) {[[BR]] return 2;[[BR]] }[[BR]] if (word < 0x200000) {[[BR]] return 3;[[BR]] }[[BR]] if (word < 0x4000000) {[[BR]] return 4;[[BR]] }[[BR]] return 5;[[BR]] } [[BR]] else { [[BR]] return 2;[[BR]] } [[BR]] #endif[[BR]] The comparision WCHAR_MAX > 0x10000 will be done on runtime, and not at compile time, but on runtime the type cast is ok.[[BR]] Regards,[[BR]] Vladimir Penev",Bugs,closed,Boost 1.43.0,program_options,Boost 1.42.0,Problem,wontfix,,