aboutsummaryrefslogtreecommitdiffstats
path: root/src/assuan-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/assuan-io.c')
-rw-r--r--src/assuan-io.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/assuan-io.c b/src/assuan-io.c
index 3fe11e6..321f2ba 100644
--- a/src/assuan-io.c
+++ b/src/assuan-io.c
@@ -29,6 +29,7 @@
#include <windows.h>
#endif
+#ifndef _ASSUAN_NO_PTH
extern ssize_t pth_read (int fd, void *buffer, size_t size);
extern ssize_t pth_write (int fd, const void *buffer, size_t size);
@@ -36,29 +37,34 @@ extern ssize_t pth_write (int fd, const void *buffer, size_t size);
#pragma weak pth_read
#pragma weak pth_write
#endif
+#endif /*!_ASSUAN_NO_PTH*/
ssize_t
_assuan_simple_read (assuan_context_t ctx, void *buffer, size_t size)
{
-#ifndef HAVE_W32_SYSTEM
- return (pth_read ? pth_read : read) (ctx->inbound.fd, buffer, size);
+#ifdef _ASSUAN_NO_PTH
+ return read (ctx->inbound.fd, buffer, size);
#else
+# ifndef HAVE_W32_SYSTEM
+ return (pth_read ? pth_read : read) (ctx->inbound.fd, buffer, size);
+# else
return pth_read ? pth_read (ctx->inbound.fd, buffer, size)
: recv (ctx->inbound.fd, buffer, size, 0);
-#endif
+# endif
+# endif
}
ssize_t
_assuan_simple_write (assuan_context_t ctx, const void *buffer, size_t size)
{
-#ifndef HAVE_W32_SYSTEM
- return (pth_write ? pth_write : write) (ctx->outbound.fd, buffer, size);
+#ifdef _ASSUAN_NO_PTH
+ return write (ctx->outbound.fd, buffer, size);
#else
+# ifndef HAVE_W32_SYSTEM
+ return (pth_write ? pth_write : write) (ctx->outbound.fd, buffer, size);
+# else
return pth_write ? pth_write (ctx->outbound.fd, buffer, size)
: send (ctx->outbound.fd, buffer, size, 0);
+# endif
#endif
}
-
-
-
-