From 4ec9c4a1db8e2e2719ac71b1d8f3f857c2f8bd6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 30 Mar 2023 17:35:00 +0200 Subject: [PATCH] Cleanup the last Windows / MSC ifdefs and comments Cleanup the remnants of MS Compiler bits from , printing the information in named/main.c, and cleanup some comments about Windows that no longer apply. The bits in picohttpparser.{h,c} were left out, because it's not our code. --- bin/named/main.c | 8 ----- bin/tests/system/runtime/tests.sh | 2 +- bin/tests/system/shutdown/tests_shutdown.py | 2 +- doc/dnssec-guide/validation.rst | 3 +- fuzz/dns_message_checksig.c | 5 ++- lib/dns/include/dns/name.h | 6 ++-- lib/dns/zone.c | 5 --- lib/isc/include/isc/backtrace.h | 1 - lib/isc/include/isc/refcount.h | 35 +-------------------- lib/isc/netmgr/socket.c | 3 -- 10 files changed, 8 insertions(+), 62 deletions(-) diff --git a/bin/named/main.c b/bin/named/main.c index 7f8fbd76c8..6d73b338bc 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -571,9 +571,6 @@ printversion(bool verbose) { #endif /* ifdef __GNUC__ */ #endif /* if defined(__ICC) || defined(__INTEL_COMPILER) */ #endif /* ifdef __clang__ */ -#ifdef _MSC_VER - printf("compiled by MSVC %d\n", _MSC_VER); -#endif /* ifdef _MSC_VER */ #ifdef __SUNPRO_C printf("compiled by Solaris Studio %x\n", __SUNPRO_C); #endif /* ifdef __SUNPRO_C */ @@ -1139,11 +1136,6 @@ setup(void) { #endif /* ifdef __GNUC__ */ #endif /* if defined(__ICC) || defined(__INTEL_COMPILER) */ #endif /* ifdef __clang__ */ -#ifdef _MSC_VER - isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, - NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, - "compiled by MSVC %d", _MSC_VER); -#endif /* ifdef _MSC_VER */ #ifdef __SUNPRO_C isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, diff --git a/bin/tests/system/runtime/tests.sh b/bin/tests/system/runtime/tests.sh index ac29ee3869..0920b56342 100644 --- a/bin/tests/system/runtime/tests.sh +++ b/bin/tests/system/runtime/tests.sh @@ -245,7 +245,7 @@ if [ "$(id -u)" -eq 0 ]; then if [ $ret -ne 0 ]; then echo_i "failed"; fi status=$((status+ret)) else - echo_i "skipped, not running as root or running on Windows" + echo_i "skipped, not running as root" fi echo_i "exit status: $status" diff --git a/bin/tests/system/shutdown/tests_shutdown.py b/bin/tests/system/shutdown/tests_shutdown.py index 46c2d509b1..bcda274cd3 100755 --- a/bin/tests/system/shutdown/tests_shutdown.py +++ b/bin/tests/system/shutdown/tests_shutdown.py @@ -40,7 +40,7 @@ def do_work(named_proc, resolver, rndc_cmd, kill_method, n_workers, n_queries): if kill_method=="rndc" named will be asked to shutdown by means of rndc stop. if kill_method=="sigterm" named will be killed by SIGTERM on - POSIX systems or by TerminateProcess() on Windows systems. + POSIX systems. :param named_proc: named process instance :type named_proc: subprocess.Popen diff --git a/doc/dnssec-guide/validation.rst b/doc/dnssec-guide/validation.rst index 93021e5cc8..a499587983 100644 --- a/doc/dnssec-guide/validation.rst +++ b/doc/dnssec-guide/validation.rst @@ -128,8 +128,7 @@ While :iscman:`nslookup` is popular, partly because it comes pre-installed on most systems, it is not DNSSEC-aware. :iscman:`dig`, on the other hand, fully supports the DNSSEC standard and comes as a part of BIND. If you do not have :iscman:`dig` already installed on your system, install it by downloading -it from ISC's `website `__. ISC provides pre-compiled -Windows versions on its website. +it from ISC's `website `__. :iscman:`dig` is a flexible tool for interrogating DNS name servers. It performs DNS lookups and displays the answers that are returned from the diff --git a/fuzz/dns_message_checksig.c b/fuzz/dns_message_checksig.c index b21665c4bf..6679df60bd 100644 --- a/fuzz/dns_message_checksig.c +++ b/fuzz/dns_message_checksig.c @@ -160,9 +160,8 @@ cleanup(void) { /* * Restore working directory if possible before cleaning * up the key directory. This will help with any other - * cleanup routines and if this code is ever run under - * Windows as the directory should not be in use when - * rmdir() is called. + * cleanup routines as the directory should not be in use + * when rmdir() is called. */ if (pwd != NULL && chdir(pwd) != 0) { fprintf(stderr, "can't restore working directory: %s\n", diff --git a/lib/dns/include/dns/name.h b/lib/dns/include/dns/name.h index e079a59a1e..f525c43495 100644 --- a/lib/dns/include/dns/name.h +++ b/lib/dns/include/dns/name.h @@ -1192,10 +1192,8 @@ dns_name_settotextfilter(dns_name_totextfilter_t *proc); * Set / clear a thread specific function 'proc' to be called at the * end of dns_name_totext(). * - * Note: Under Windows you need to call "dns_name_settotextfilter(NULL);" - * prior to exiting the thread otherwise memory will be leaked. - * For other platforms, which are pthreads based, this is still a good - * idea but not required. + * Note: It's a good practice to call "dns_name_settotextfilter(NULL);" + * prior to exiting the thread. * * Returns *\li #ISC_R_SUCCESS diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 5a8ce4f129..450af4b679 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -540,11 +540,6 @@ typedef enum { * notify due to the zone * just being loaded for * the first time. */ - /* - * DO NOT add any new zone flags here until all platforms - * support 64-bit enum values. Currently they fail on - * Windows. - */ DNS_ZONEFLG___MAX = UINT64_MAX, /* trick to make the ENUM 64-bit wide */ } dns_zoneflg_t; diff --git a/lib/isc/include/isc/backtrace.h b/lib/isc/include/isc/backtrace.h index c8fa3242b0..7605b6f967 100644 --- a/lib/isc/include/isc/backtrace.h +++ b/lib/isc/include/isc/backtrace.h @@ -79,7 +79,6 @@ isc_backtrace_symbols(void *const *buffer, int size); * * Notes: * - *\li On Windows, this is shim implementation using SymFromAddr() *\li On systems with backtrace_symbols(), it's just a thin wrapper *\li Otherwise, it returns NULL *\li See platform NOTES for backtrace_symbols diff --git a/lib/isc/include/isc/refcount.h b/lib/isc/include/isc/refcount.h index 752f3e426f..8231233072 100644 --- a/lib/isc/include/isc/refcount.h +++ b/lib/isc/include/isc/refcount.h @@ -48,12 +48,9 @@ typedef atomic_uint_fast32_t isc_refcount_t; * \brief Returns current number of references. * \param[in] ref pointer to reference counter. * \returns current value of reference counter. - * - * Undo implicit promotion to 64 bits in our Windows implementation of - * atomic_load_explicit() by casting to uint_fast32_t. */ -#define isc_refcount_current(target) (uint_fast32_t) atomic_load_acquire(target) +#define isc_refcount_current(target) atomic_load_acquire(target) /** \def isc_refcount_destroy(ref) * \brief a destructor that makes sure that all references were cleared. @@ -68,15 +65,6 @@ typedef atomic_uint_fast32_t isc_refcount_t; * \param[in] ref pointer to reference counter. * \returns previous value of reference counter. */ -#if _MSC_VER -static inline uint_fast32_t -isc_refcount_increment0(isc_refcount_t *target) { - uint_fast32_t __v; - __v = (uint_fast32_t)atomic_fetch_add_relaxed(target, 1); - INSIST(__v < UINT32_MAX); - return (__v); -} -#else /* _MSC_VER */ #define isc_refcount_increment0(target) \ ({ \ uint_fast32_t __v; \ @@ -84,22 +72,12 @@ isc_refcount_increment0(isc_refcount_t *target) { INSIST(__v < UINT32_MAX); \ __v; \ }) -#endif /* _MSC_VER */ /** \def isc_refcount_increment(ref) * \brief increases reference counter by 1. * \param[in] ref pointer to reference counter. * \returns previous value of reference counter. */ -#if _MSC_VER -static inline uint_fast32_t -isc_refcount_increment(isc_refcount_t *target) { - uint_fast32_t __v; - __v = (uint_fast32_t)atomic_fetch_add_relaxed(target, 1); - INSIST(__v > 0 && __v < UINT32_MAX); - return (__v); -} -#else /* _MSC_VER */ #define isc_refcount_increment(target) \ ({ \ uint_fast32_t __v; \ @@ -107,22 +85,12 @@ isc_refcount_increment(isc_refcount_t *target) { INSIST(__v > 0 && __v < UINT32_MAX); \ __v; \ }) -#endif /* _MSC_VER */ /** \def isc_refcount_decrement(ref) * \brief decreases reference counter by 1. * \param[in] ref pointer to reference counter. * \returns previous value of reference counter. */ -#if _MSC_VER -static inline uint_fast32_t -isc_refcount_decrement(isc_refcount_t *target) { - uint_fast32_t __v; - __v = (uint_fast32_t)atomic_fetch_sub_acq_rel(target, 1); - INSIST(__v > 0); - return (__v); -} -#else /* _MSC_VER */ #define isc_refcount_decrement(target) \ ({ \ uint_fast32_t __v; \ @@ -130,7 +98,6 @@ isc_refcount_decrement(isc_refcount_t *target) { INSIST(__v > 0); \ __v; \ }) -#endif /* _MSC_VER */ #define isc_refcount_decrementz(target) \ do { \ diff --git a/lib/isc/netmgr/socket.c b/lib/isc/netmgr/socket.c index fc9b3ce880..2b1e0e652e 100644 --- a/lib/isc/netmgr/socket.c +++ b/lib/isc/netmgr/socket.c @@ -170,9 +170,6 @@ isc__nm_socket_reuse(uv_os_sock_t fd) { * On Linux, SO_REUSEPORT has different semantics: it _shares_ the port * rather than steal it from the current listener, so we don't use it * here, but rather in isc__nm_socket_reuse_lb(). - * - * On Windows, it also allows a socket to forcibly bind to a port in use - * by another socket. */ #if defined(SO_REUSEPORT) && !defined(__linux__)