Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78038 - trunk/libs/context/src
From: oliver.kowalke_at_[hidden]
Date: 2012-04-17 06:16:30


Author: olli
Date: 2012-04-17 06:16:29 EDT (Tue, 17 Apr 2012)
New Revision: 78038
URL: http://svn.boost.org/trac/boost/changeset/78038

Log:
context: MACRO for snprint

Text files modified:
   trunk/libs/context/src/seh.cpp | 10 ++++++++--
   1 files changed, 8 insertions(+), 2 deletions(-)

Modified: trunk/libs/context/src/seh.cpp
==============================================================================
--- trunk/libs/context/src/seh.cpp (original)
+++ trunk/libs/context/src/seh.cpp 2012-04-17 06:16:29 EDT (Tue, 17 Apr 2012)
@@ -14,6 +14,12 @@
 #include <windows.h>
 #include <winnt.h>
 
+#if defined(_MSC_VER)
+# define SNPRINTF _snprintf
+#else
+# define SNPRINTF snprintf
+#endif
+
 static char * exception_description(
     _EXCEPTION_RECORD const* record, char * description, size_t len)
 {
@@ -26,7 +32,7 @@
     {
         const char * accessType = ( info[0]) ? "writing" : "reading";
         const ULONG_PTR address = info[1];
- snprintf( description, len, "Access violation %s 0x%08X", accessType, address);
+ SNPRINTF( description, len, "Access violation %s 0x%08X", accessType, address);
         return description;
     }
     case EXCEPTION_DATATYPE_MISALIGNMENT: return "Datatype misalignment";
@@ -52,7 +58,7 @@
     case EXCEPTION_INVALID_HANDLE: return "Invalid handle";
     }
 
- snprintf( description, len, "Unknown (0x%08X)", code);
+ SNPRINTF( description, len, "Unknown (0x%08X)", code);
     return description;
 }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk