[serialization] patch for test_tools.hpp for HP-UX

Attached is patch for serialization/test/test_tools.hpp header which works around a documented problem with tmpnam() function on HP-UX, both ia64 and PA-RISC. The problem is that tmpnam() function is useless when called with NULL argument from a program compiled -mt, which is how boost is compiled on HP-UX/aCC. The tempnam() function does not have this limitaiton and the HP-UX-specific patch below redefines tmpnam as tempnam. This problem was causing hundreds of serialization library tests to fail. With the patch, all serialization library tests pass. I've verified, that the patch does not cause any regression. The patch below is for CVS HEAD. Can it be applied to HEAD and merged into the RC_1_34_0 branch? Thanks, Boris Index: test_tools.hpp =================================================================== RCS file: /cvsroot/boost/boost/libs/serialization/test/test_tools.hpp,v retrieving revision 1.14 diff -r1.14 test_tools.hpp 12a13
// (C) Copyright 2006 Boris Gubenko. 85a87,103 // HP-UX has a restriction that for multi-thread applications, (i.e. // the ones compiled -mt) if argument to tmpnam is a NULL pointer, then, // citing the tmpnam(3S) manpage, "the operation is not performed and a // NULL pointer is returned". tempnam does not have this restriction, so, // let's use tempnam instead. #if defined(__hpux)
#define tmpnam(X) tempnam(NULL,X)
namespace boost { namespace archive { using ::tempnam; } // archive } // boost
#endif // defined(__hpux)

Excellent work !!! - I'll put in the patch Robert Ramey Boris Gubenko wrote:
Attached is patch for serialization/test/test_tools.hpp header which works around a documented problem with tmpnam() function on HP-UX, both ia64 and PA-RISC.
The problem is that tmpnam() function is useless when called with NULL argument from a program compiled -mt, which is how boost is compiled on HP-UX/aCC. The tempnam() function does not have this limitaiton and the HP-UX-specific patch below redefines tmpnam as tempnam.
This problem was causing hundreds of serialization library tests to fail. With the patch, all serialization library tests pass.
I've verified, that the patch does not cause any regression.
The patch below is for CVS HEAD. Can it be applied to HEAD and merged into the RC_1_34_0 branch?
Thanks, Boris
Index: test_tools.hpp =================================================================== RCS file: /cvsroot/boost/boost/libs/serialization/test/test_tools.hpp,v retrieving revision 1.14 diff -r1.14 test_tools.hpp 12a13
// (C) Copyright 2006 Boris Gubenko. 85a87,103 // HP-UX has a restriction that for multi-thread applications, (i.e. // the ones compiled -mt) if argument to tmpnam is a NULL pointer, then, // citing the tmpnam(3S) manpage, "the operation is not performed and a // NULL pointer is returned". tempnam does not have this restriction, so, // let's use tempnam instead. #if defined(__hpux)
#define tmpnam(X) tempnam(NULL,X)
namespace boost { namespace archive { using ::tempnam; } // archive } // boost
#endif // defined(__hpux)
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Boris Gubenko
-
Robert Ramey