[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg-devel
Subject:    [PATCH libxtrans 2/3] Use font server ErrorF/VErrorF instead of private versions
From:       Keith Packard <keithp () keithp ! com>
Date:       2014-01-29 20:54:26
Message-ID: 1391028867-8651-3-git-send-email-keithp () keithp ! com
[Download RAW message or body]

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@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)
-- 
1.8.5.3

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic