diff options
author | Yves Orton <demerphq@gmail.com> | 2022-08-06 22:48:04 +0200 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2022-08-09 14:08:10 +0200 |
commit | 86d84dd06fe16998648c41a393a25a59b9c470b7 (patch) | |
tree | c21c3218ada6a4611f63ebcac03b568d337d96c7 /hv_func.h | |
parent | 58411bc7381d696a6aa53ea5106866fc975fe9ae (diff) | |
download | perl-86d84dd06fe16998648c41a393a25a59b9c470b7.tar.gz |
perl.c - remove code for reporting state of non-existent defines in -V
Most of the hash based defines are no longer supported, so remove them.
Also at the same time introduce a new simpler way to track which hash
function we are using. Also add the info about if SBOX32 is in use.
This removes the need to keep the list of hash functions supported in
two places, hv_func.h and perl.c. Instead hv_func.h drives the whole
process and perl.c just does what it is told.
Previously the way to control SBOX32 was to use a define with a value
but our perl -V output currently doesnt support that, so this adds some
two new defines PERL_HASH_USE_SBOX32 and PERL_HASH_NO_SBOX32 which map
to the older PERL_HASH_USE_SBOX32_ALSO flag define (integer 1/0).
Both are still supported, this just makes everything more consistent.
This also includes minor doc changes to INSTALL to mention -Accflags
as being the way to set these defines during the Configure process.
Diffstat (limited to 'hv_func.h')
-rw-r--r-- | hv_func.h | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -23,7 +23,19 @@ #endif #ifndef PERL_HASH_USE_SBOX32_ALSO -#define PERL_HASH_USE_SBOX32_ALSO 1 +# if defined(PERL_HASH_USE_SBOX32) || !defined(PERL_HASH_NO_SBOX32) +# define PERL_HASH_USE_SBOX32_ALSO 1 +# else +# define PERL_HASH_USE_SBOX32_ALSO 0 +# endif +#endif + +#undef PERL_HASH_USE_SBOX32 +#undef PERL_HASH_NO_SBOX32 +#if PERL_HASH_USE_SBOX32_ALSO != 0 +# define PERL_HASH_USE_SBOX32 +#else +# define PERL_HASH_NO_SBOX32 #endif #ifndef SBOX32_MAX_LEN @@ -34,6 +46,7 @@ #include "sbox32_hash.h" #if defined(PERL_HASH_FUNC_SIPHASH) +# define PERL_HASH_FUNC_DEFINE "PERL_HASH_FUNC_SIPHASH" # define PVT__PERL_HASH_FUNC "SIPHASH_2_4" # define PVT__PERL_HASH_WORD_TYPE U64 # define PVT__PERL_HASH_WORD_SIZE sizeof(PVT__PERL_HASH_WORD_TYPE) @@ -42,6 +55,7 @@ # define PVT__PERL_HASH_SEED_STATE(seed,state) S_perl_siphash_seed_state(seed,state) # define PVT__PERL_HASH_WITH_STATE(state,str,len) S_perl_hash_siphash_2_4_with_state((state),(U8*)(str),(len)) #elif defined(PERL_HASH_FUNC_SIPHASH13) +# define PERL_HASH_FUNC_DEFINE "PERL_HASH_FUNC_SIPHASH13" # define PVT__PERL_HASH_FUNC "SIPHASH_1_3" # define PVT__PERL_HASH_WORD_TYPE U64 # define PVT__PERL_HASH_WORD_SIZE sizeof(PVT__PERL_HASH_WORD_TYPE) @@ -50,6 +64,7 @@ # define PVT__PERL_HASH_SEED_STATE(seed,state) S_perl_siphash_seed_state(seed,state) # define PVT__PERL_HASH_WITH_STATE(state,str,len) S_perl_hash_siphash_1_3_with_state((state),(U8*)(str),(len)) #elif defined(PERL_HASH_FUNC_ZAPHOD32) +# define PERL_HASH_FUNC_DEFINE "PERL_HASH_FUNC_ZAPHOD32" # define PVT__PERL_HASH_FUNC "ZAPHOD32" # define PVT__PERL_HASH_WORD_TYPE U32 # define PVT__PERL_HASH_WORD_SIZE sizeof(PVT__PERL_HASH_WORD_TYPE) @@ -82,7 +97,7 @@ #define PL_hash_seed ((U8 *)PL_hash_seed_w) #define PL_hash_state ((U8 *)PL_hash_state_w) -#if PERL_HASH_USE_SBOX32_ALSO != 1 +#if PERL_HASH_USE_SBOX32_ALSO == 0 # define PVT_PERL_HASH_FUNC PVT__PERL_HASH_FUNC # define PVT_PERL_HASH_SEED_BYTES PVT__PERL_HASH_SEED_BYTES # define PVT_PERL_HASH_STATE_BYTES PVT__PERL_HASH_STATE_BYTES |