2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

Merge branch 'aydin/isc_header_atomic_fix' into 'main'

Use and check for <isc/atomic.h> instead of <stdatomic.h> directly

See merge request isc-projects/bind9!8582
This commit is contained in:
Aydın Mercan 2024-01-03 17:47:53 +00:00
commit e112d0775e
3 changed files with 23 additions and 2 deletions

View File

@ -14,7 +14,6 @@
#include <assert.h>
#include <errno.h>
#include <math.h>
#include <stdatomic.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>

View File

@ -13,6 +13,7 @@
#pragma once
#include <isc/atomic.h>
#include <isc/result.h>
/*! \file isc/types.h
@ -20,7 +21,6 @@
* OS-specific types, from the OS-specific include directories.
*/
#include <limits.h>
#include <stdatomic.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

View File

@ -42,4 +42,26 @@ list=$(git grep -l uintptr_t lib bin \
echo "$list"
}
#
# Check for the direct usage of stdatomic.h
#
list=$(git grep -l stdatomic.h lib bin ':(exclude)lib/isc/include/isc/atomic\.h' \
| grep -e '\.c$' -e '\.h$')
[ -n "$list" ] && {
status=1
echo 'Use #include <isc/atomic.h> instead of #include <stdatomic.h>:'
echo "$list"
}
#
# Check for the usage of explicit memory ordering
#
list=$(git grep -l memory_order_.* lib bin ':(exclude)lib/isc/include/isc/atomic\.h' \
| grep -e '\.c$' -e '\.h$')
[ -n "$list" ] && {
status=1
echo 'Prefer the helpers in <isc/atomic.h> over specifying an explicit memory order:'
echo "$list"
}
exit $status