diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-05-24 16:22:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-24 16:22:59 -0700 |
commit | 5734f41a9b46b4fd65b6ba90240b108f8a0b7c57 (patch) | |
tree | 6f3f2aec5631ee53c66d469ac3b3a5ed81c13b45 /configure.ac | |
parent | d9eb22c67c38b45764dd924801c72092770d200f (diff) | |
download | cpython-git-5734f41a9b46b4fd65b6ba90240b108f8a0b7c57.tar.gz |
bpo-32493: Fix uuid.uuid1() on FreeBSD. (GH-7099)
Use uuid_enc_be() if available to encode UUID to bytes as big endian.
(cherry picked from commit 17d8830312d82e7de42ab89739b0771f712645ff)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 2535969642..59489047fc 100644 --- a/configure.ac +++ b/configure.ac @@ -2742,6 +2742,21 @@ void *x = uuid_create [AC_MSG_RESULT(no)] ) +# Little-endian FreeBSD, OpenBSD and NetBSD needs encoding into an octet +# stream in big-endian byte-order +AC_MSG_CHECKING(for uuid_enc_be) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <uuid.h>]], [[ +#ifndef uuid_enc_be +uuid_t uuid; +unsigned char buf[sizeof(uuid)]; +uuid_enc_be(buf, &uuid); +#endif +]])], + [AC_DEFINE(HAVE_UUID_ENC_BE, 1, Define if uuid_enc_be() exists.) + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)] +) + # 'Real Time' functions on Solaris # posix4 on Solaris 2.6 # pthread (first!) on Linux |