summaryrefslogtreecommitdiff
path: root/Xtransint.h
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-24 07:43:07 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-10-01 08:55:03 -0700
commitcbdb434033da1725a69014cc6e4d89c691a6fd95 (patch)
treebfdea46cdeddf426ff7bb1ab736fbb6696a80c83 /Xtransint.h
parentcf39d738086b0a7c668fb3720d64de8d711a1a97 (diff)
downloadxorg-lib-libxtrans-cbdb434033da1725a69014cc6e4d89c691a6fd95.tar.gz
Fix warnings about static functions declared but never defined
Add #define XTRANS_TRANSPORT_C to transport.c and check for it before making static function declarations and other bits needed only when compiling the Xtrans code itself, not from other sources that include the Xtransint.h header for the struct definitions. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'Xtransint.h')
-rw-r--r--Xtransint.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/Xtransint.h b/Xtransint.h
index 787d721..47d98ba 100644
--- a/Xtransint.h
+++ b/Xtransint.h
@@ -68,7 +68,7 @@ from The Open Group.
* message.
*/
-#ifndef XTRANSDEBUG
+#if !defined(XTRANSDEBUG) && defined(XTRANS_TRANSPORT_C)
# define XTRANSDEBUG 1
#endif
@@ -307,6 +307,9 @@ typedef struct _Xtransport_table {
/* Flags to preserve when setting others */
#define TRANS_KEEPFLAGS (TRANS_NOUNLINK|TRANS_ABSTRACT)
+#ifdef XTRANS_TRANSPORT_C /* only provide static function prototypes when
+ building the transport.c file that has them in */
+
#ifdef __clang__
/* Not all clients make use of all provided statics */
#pragma clang diagnostic push
@@ -421,4 +424,6 @@ static int trans_mkdir (
#define PRMSG(lvl,x,a,b,c) ((void)0)
#endif /* XTRANSDEBUG */
+#endif /* XTRANS_TRANSPORT_C */
+
#endif /* _XTRANSINT_H_ */