summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xtransint.h7
-rw-r--r--transport.c3
2 files changed, 9 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_ */
diff --git a/transport.c b/transport.c
index 0013b01..c14057d 100644
--- a/transport.c
+++ b/transport.c
@@ -53,6 +53,9 @@ from The Open Group.
#define xrealloc(_ptr,_size) realloc(_ptr,_size)
#define xfree(_ptr) free(_ptr)
+#define XTRANS_TRANSPORT_C /* used to flag Xtransint.h that it's being used
+ here, not just #included in another file */
+
#include "Xtransint.h"
#ifdef __clang__