[PATCH libxtrans 2/3] Use font server ErrorF/VErrorF instead of private versions

Keith Packard keithp at keithp.com
Wed Jan 29 12:54:26 PST 2014

XTrans creates custom ErrorF/VErrorF functions when the including
project doesn't provide them, however the test for that is weak and xtrans
ends up using the private versions for the font server as well.

This means that all xtrans error messages will not be included in the
font server log. It also causes redefinition warnings when building
the font server (which is how this problem was identified).

However, the font server doesn't currently provide a VErrorF function,
so instead of just always relying on the font server to provide these
functions, this patch uses a new TRANS_HAS_ERRORF define to select
whether the project-provided or internal versions will be used. A
patch to the font server that adds VErrorF and defines
TRANS_HAS_ERRORF will be required to fix this bug.

Signed-off-by: Keith Packard <keithp at keithp.com>
 Xtransint.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Xtransint.h b/Xtransint.h
index 6fc2811..b910eaa 100644
--- a/Xtransint.h
+++ b/Xtransint.h
@@ -401,10 +401,11 @@ static int trans_mkdir (
 #include <stdarg.h>
- * The X server provides ErrorF() & VErrorF(), for other software that uses
- * xtrans, we provide our own simple versions.
+ * The X server and the font server both provide ErrorF() & VErrorF(). For
+ * other software that uses xtrans, we provide our own simple
+ * versions.
-# if defined(XSERV_t) && defined(TRANS_SERVER)
+# if (defined(XSERV_t) || defined(TRANS_HAS_ERRORF)) && defined(TRANS_SERVER)
 #  include "os.h"
 # else
 static inline void _X_ATTRIBUTE_PRINTF(1, 0)

More information about the xorg-devel mailing list