# HG changeset patch
# User Teemu Piippo <crimsondusk64@gmail.com>
# Date 1399218185 -10800
# Node ID 885fd60e8bf17d10316b562a2df9937acb2f6018
# Parent  54f27fa8f32f0f9438b6853696142f202fac22ef
- add macro to string

diff -r 54f27fa8f32f -r 885fd60e8bf1 src/macros.h
--- a/src/macros.h	Sun May 04 18:34:31 2014 +0300
+++ b/src/macros.h	Sun May 04 18:43:05 2014 +0300
@@ -39,6 +39,9 @@
 #define VERSION_MINOR	0
 #define VERSION_PATCH 	0
 
+#define MACRO_TO_STRING_HELPER(A) #A
+#define MACRO_TO_STRING(A) MACRO_TO_STRING_HELPER(A)
+
 #define MAKE_VERSION_NUMBER(MAJ, MIN, PAT) ((MAJ * 10000) + (MIN * 100) + PAT)
 #define VERSION_NUMBER MAKE_VERSION_NUMBER (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
 
@@ -63,7 +66,7 @@
 
 #ifdef DEBUG
 # define BOTC_GENERIC_ASSERT(A,B,OP,COMPLAINT) ((A OP B) ? (void) 0 : \
-	error ("assertion failed at " __FILE__ ":%1: " #A " (%2) " COMPLAINT " " #B " (%3)", __LINE__, A, B));
+	error ("assertion failed at " __FILE__ ":" MACRO_TO_STRING(__LINE__) ": " #A " (%1) " COMPLAINT " " #B " (%2)", A, B));
 #else
 # define BOTC_GENERIC_ASSERT(A,B,OP,COMPLAINT) {}
 #endif