[Scummvm-cvs-logs] SF.net SVN: scummvm:[53931] scummvm/trunk/common/util.h

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Oct 30 02:32:46 CEST 2010


Revision: 53931
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53931&view=rev
Author:   fingolfin
Date:     2010-10-30 00:32:45 +0000 (Sat, 30 Oct 2010)

Log Message:
-----------
COMMON: Add SCUMMVM_CURRENT_FUNCTION macro (useful for debugging)

Modified Paths:
--------------
    scummvm/trunk/common/util.h

Modified: scummvm/trunk/common/util.h
===================================================================
--- scummvm/trunk/common/util.h	2010-10-29 22:20:10 UTC (rev 53930)
+++ scummvm/trunk/common/util.h	2010-10-30 00:32:45 UTC (rev 53931)
@@ -63,6 +63,20 @@
 #define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0])))
 
 
+/**
+ * @def SCUMMVM_CURRENT_FUNCTION
+ * This macro evaluates to the current function's name on compilers supporting this.
+ */
+#if defined(__GNUC__)
+# define SCUMMVM_CURRENT_FUNCTION __PRETTY_FUNCTION__
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
+#  define SCUMMVM_CURRENT_FUNCTION	__func__
+#elif defined(_MSC_VER) && _MSC_VER >= 1300
+#  define SCUMMVM_CURRENT_FUNCTION __FUNCTION__
+#else
+#  define SCUMMVM_CURRENT_FUNCTION "<unknown>"
+#endif
+
 namespace Common {
 
 /**


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list