Cleanup the last Windows / MSC ifdefs and comments

Cleanup the remnants of MS Compiler bits from <isc/refcount.h>, 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.
This commit is contained in:
Ondřej Surý 2023-03-30 17:35:00 +02:00
parent 01218f16e2
commit 4ec9c4a1db
10 changed files with 8 additions and 62 deletions

View file

@ -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,

View file

@ -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"

View file

@ -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

View file

@ -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 <https://www.isc.org/download>`__. ISC provides pre-compiled
Windows versions on its website.
it from ISC's `website <https://www.isc.org/download>`__.
:iscman:`dig` is a flexible tool for interrogating DNS name servers. It
performs DNS lookups and displays the answers that are returned from the

View file

@ -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",

View file

@ -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

View file

@ -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;

View file

@ -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

View file

@ -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 { \

View file

@ -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__)