[x265] Move XSTR macro to common.h

Mateusz Brzostek mateusz at msystem.waw.pl
Mon Jan 30 18:06:15 CET 2017


In common/version.cpp it is a macro XSTR.
We could move the macro to common.h and use it for error/warning messages like LigH pointed in 'complexAnalysis: clean up' thread.

# HG changeset patch
# User Ma0 <mateuszb at poczta.onet.pl>
# Date 1485793398 -3600
#      Mon Jan 30 17:23:18 2017 +0100
# Node ID f3cfc60b1011ca006bb18bb82e9ee69200e4313a
# Parent  fa52b516f5ff122c4486ed840c5bf1de3c06e974
Move XSTR macro to common.h

diff -r fa52b516f5ff -r f3cfc60b1011 source/common/common.h
--- a/source/common/common.h    Mon Jan 30 10:35:00 2017 +0530
+++ b/source/common/common.h    Mon Jan 30 17:23:18 2017 +0100
@@ -42,6 +42,9 @@
 
 #include "x265.h"
 
+#define XSTR(x) XSTRi(x)
+#define XSTRi(x) #x
+
 #if ENABLE_PPA && ENABLE_VTUNE
 #error "PPA and VTUNE cannot both be enabled. Disable one of them."
 #endif
diff -r fa52b516f5ff -r f3cfc60b1011 source/common/param.cpp
--- a/source/common/param.cpp    Mon Jan 30 10:35:00 2017 +0530
+++ b/source/common/param.cpp    Mon Jan 30 17:23:18 2017 +0100
@@ -1170,7 +1170,7 @@
     CHECK(param->rdoqLevel < 0 || param->rdoqLevel > 2,
         "RDOQ Level is out of range");
     CHECK(param->complexAnalysis < 0 || param->complexAnalysis > X265_MAX_ANALYSIS_STRENGTH,
-        "Complex analysis strength must be between 0 and 4");
+        "Complex analysis strength must be between 0 and " XSTR(X265_MAX_ANALYSIS_STRENGTH));
     CHECK(param->bframes && param->bframes >= param->lookaheadDepth && !param->rc.bStatRead,
           "Lookahead depth must be greater than the max consecutive bframe count");
     CHECK(param->bframes < 0,
diff -r fa52b516f5ff -r f3cfc60b1011 source/common/version.cpp
--- a/source/common/version.cpp    Mon Jan 30 10:35:00 2017 +0530
+++ b/source/common/version.cpp    Mon Jan 30 17:23:18 2017 +0100
@@ -26,9 +26,6 @@
 #include "common.h"
 #include "primitives.h"
 
-#define XSTR(x) STR(x)
-#define STR(x) #x
-
 #if defined(__clang__)
 #define COMPILEDBY  "[clang " XSTR(__clang_major__) "." XSTR(__clang_minor__) "." XSTR(__clang_patchlevel__) "]"
 #ifdef __IA64__



More information about the x265-devel mailing list