diff options
author | Norbert Preining <norbert@preining.info> | 2020-09-20 03:03:26 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-09-20 03:03:26 +0000 |
commit | 1f457376b478257b88d4a857f5ec1b6155442dd7 (patch) | |
tree | 2a06a60551dea362cf8cb0cb0ba66c78608717c4 /support/dktools/dk4sock10.ctr | |
parent | ac690ca29ad5bf8a5203a65fd6252f7b564f4727 (diff) |
CTAN sync 202009200303
Diffstat (limited to 'support/dktools/dk4sock10.ctr')
-rw-r--r-- | support/dktools/dk4sock10.ctr | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/support/dktools/dk4sock10.ctr b/support/dktools/dk4sock10.ctr index b7f58e8feb..b267268e0a 100644 --- a/support/dktools/dk4sock10.ctr +++ b/support/dktools/dk4sock10.ctr @@ -2,12 +2,13 @@ copyright owner = Dirk Krause copyright year = 2015-xxxx -license = bsd +SPDX-License-Identifier: BSD-3-Clause %% module +#include "dk4conf.h" #include "dk4sock.h" #include <stdio.h> @@ -33,6 +34,14 @@ license = bsd #endif #endif +#if DK4_HAVE_ASSERT_H +#ifndef ASSERT_H_INCLUDED +#include <assert.h> +#define ASSERT_H_INCLUDED 1 +#endif +#endif + + $!trace-include @@ -83,7 +92,9 @@ int dk4socket_close(dk4_socket_t so, dk4_er_t *erp) { int back = DK4_SOCKET_RESULT_FAILED; - +#if DK4_USE_ASSERT + assert(INVALID_SOCKET != so); +#endif if (INVALID_SOCKET != so) { dk4socket_error_reset(); #if DK4_ON_WINDOWS @@ -108,6 +119,9 @@ int dk4socket_shutdown(dk4_socket_t so, int how, dk4_er_t *erp) { int back = DK4_SOCKET_RESULT_FAILED; +#if DK4_USE_ASSERT + assert(INVALID_SOCKET != so); +#endif if (INVALID_SOCKET != so) { switch (how) { case DK4_SOCKET_SHUT_READ : |