зеркало из https://github.com/github/ruby.git
Fix -Wundef warnings for patterns `#if HAVE`
* See [Feature #17752] * Using this to detect them: git grep -P 'if\s+HAVE' | grep -Pv 'HAVE_LONG_LONG|/ChangeLog|HAVE_TYPEOF'
This commit is contained in:
Родитель
fa7a712d46
Коммит
0764d323d8
6
dir.c
6
dir.c
|
@ -50,13 +50,13 @@
|
|||
# define dirent direct
|
||||
# define NAMLEN(dirent) (dirent)->d_namlen
|
||||
# define HAVE_DIRENT_NAMLEN 1
|
||||
# if HAVE_SYS_NDIR_H
|
||||
# ifdef HAVE_SYS_NDIR_H
|
||||
# include <sys/ndir.h>
|
||||
# endif
|
||||
# if HAVE_SYS_DIR_H
|
||||
# ifdef HAVE_SYS_DIR_H
|
||||
# include <sys/dir.h>
|
||||
# endif
|
||||
# if HAVE_NDIR_H
|
||||
# ifdef HAVE_NDIR_H
|
||||
# include <ndir.h>
|
||||
# endif
|
||||
# ifdef _WIN32
|
||||
|
|
|
@ -45,7 +45,7 @@ extern "C" {
|
|||
# if __has_builtin(__builtin_unreachable)
|
||||
# define UNREACHABLE __builtin_unreachable()
|
||||
|
||||
# elif HAVE___ASSUME
|
||||
# elif defined(HAVE___ASSUME)
|
||||
# define UNREACHABLE __assume(0)
|
||||
|
||||
# else
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include RUBY_EXTCONF_H
|
||||
#endif
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
|
|
4
gc.c
4
gc.c
|
@ -45,7 +45,7 @@
|
|||
#ifdef HAVE_MALLOC_USABLE_SIZE
|
||||
# ifdef RUBY_ALTERNATIVE_MALLOC_HEADER
|
||||
# include RUBY_ALTERNATIVE_MALLOC_HEADER
|
||||
# elif HAVE_MALLOC_H
|
||||
# elif defined(HAVE_MALLOC_H)
|
||||
# include <malloc.h>
|
||||
# elif defined(HAVE_MALLOC_NP_H)
|
||||
# include <malloc_np.h>
|
||||
|
@ -381,7 +381,7 @@ static ruby_gc_params_t gc_params = {
|
|||
#endif
|
||||
#if RGENGC_DEBUG < 0 && !defined(_MSC_VER)
|
||||
# define RGENGC_DEBUG_ENABLED(level) (-(RGENGC_DEBUG) >= (level) && ruby_rgengc_debug >= (level))
|
||||
#elif HAVE_VA_ARGS_MACRO
|
||||
#elif defined(HAVE_VA_ARGS_MACRO)
|
||||
# define RGENGC_DEBUG_ENABLED(level) ((RGENGC_DEBUG) >= (level))
|
||||
#else
|
||||
# define RGENGC_DEBUG_ENABLED(level) 0
|
||||
|
|
2
random.c
2
random.c
|
@ -428,7 +428,7 @@ random_init(int argc, VALUE *argv, VALUE obj)
|
|||
# define USE_DEV_URANDOM 0
|
||||
#endif
|
||||
|
||||
#if HAVE_GETENTROPY
|
||||
#ifdef HAVE_GETENTROPY
|
||||
# define MAX_SEED_LEN_PER_READ 256
|
||||
static int
|
||||
fill_random_bytes_urandom(void *seed, size_t size)
|
||||
|
|
2
signal.c
2
signal.c
|
@ -29,7 +29,7 @@
|
|||
# include <ucontext.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_PTHREAD_H
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
# include <pthread.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@ int_sip_dump(sip_state *state)
|
|||
int v;
|
||||
|
||||
for (v = 0; v < 4; v++) {
|
||||
#if HAVE_UINT64_T
|
||||
#ifdef HAVE_UINT64_T
|
||||
printf("v%d: %" PRIx64 "\n", v, state->v[v]);
|
||||
#else
|
||||
printf("v%d: %" PRIx32 "%.8" PRIx32 "\n", v, state->v[v].hi, state->v[v].lo);
|
||||
|
@ -447,7 +447,7 @@ sip_hash13(const uint8_t key[16], const uint8_t *data, size_t len)
|
|||
OR_BYTE(4);
|
||||
case 4:
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN && UNALIGNED_WORD_ACCESS
|
||||
#if HAVE_UINT64_T
|
||||
#ifdef HAVE_UINT64_T
|
||||
last |= (uint64_t) ((uint32_t *) end)[0];
|
||||
#else
|
||||
last.lo |= ((uint32_t *) end)[0];
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
#endif
|
||||
#if defined(TM_IN_SYS_TIME) || !defined(GAWK)
|
||||
#include <sys/types.h>
|
||||
#if HAVE_SYS_TIME_H
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
#ifdef HAVE_THR_STKSEGMENT
|
||||
#include <thread.h>
|
||||
#endif
|
||||
#if HAVE_FCNTL_H
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#elif HAVE_SYS_FCNTL_H
|
||||
#elif defined(HAVE_SYS_FCNTL_H)
|
||||
#include <sys/fcntl.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_PRCTL_H
|
||||
|
|
Загрузка…
Ссылка в новой задаче