Like NetBSD, OpenBSD generates version 4 UUIDs in uuid_create(), so it
cannot be used for uuid.uuid1().
(cherry picked from commit
c76fb912070389e0fbad3bf4eab066cd5da931b9)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
--- /dev/null
+Fix :func:`uuid.uuid1` on OpenBSD:
+it returned a version 4 UUID,
+because ``uuid_create()`` generates random UUIDs on this platform.
fi
-# gh-124228: While the libuuid library is available on NetBSD, it supports only UUID version 4.
+# gh-124228: While the libuuid library is available on NetBSD and OpenBSD,
+# it supports only UUID version 4.
# This restriction inhibits the proper generation of time-based UUIDs.
-if test "$ac_sys_system" = "NetBSD"; then
+if test "$ac_sys_system" = "NetBSD" || test "$ac_sys_system" = "OpenBSD"; then
have_uuid=missing
printf "%s\n" "#define HAVE_UUID_H 0" >>confdefs.h
AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [1])
])
-# gh-124228: While the libuuid library is available on NetBSD, it supports only UUID version 4.
+# gh-124228: While the libuuid library is available on NetBSD and OpenBSD,
+# it supports only UUID version 4.
# This restriction inhibits the proper generation of time-based UUIDs.
-if test "$ac_sys_system" = "NetBSD"; then
+if test "$ac_sys_system" = "NetBSD" || test "$ac_sys_system" = "OpenBSD"; then
have_uuid=missing
AC_DEFINE([HAVE_UUID_H], [0])
fi