summaryrefslogtreecommitdiffstats
path: root/uuid-workaround.patch
blob: a41e21a84ff5379a514236a1015b6564c9362cc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
diff -up uuid-1.2.0/config.m4.orig uuid-1.2.0/config.m4
--- uuid-1.2.0/config.m4.orig	2020-10-06 12:50:46.000000000 +0200
+++ uuid-1.2.0/config.m4	2024-09-30 13:55:26.600108993 +0200
@@ -18,6 +18,7 @@ if test "$PHP_UUID" != "no"; then
   PHP_CHECK_FUNC_LIB(uuid_variant, uuid)
   PHP_CHECK_FUNC_LIB(uuid_generate_md5, uuid)
   PHP_CHECK_FUNC_LIB(uuid_generate_sha1, uuid)
+  PHP_CHECK_FUNC_LIB(uuid_time64, uuid)
 
   export OLD_CPPFLAGS="$CPPFLAGS"
   export CPPFLAGS="$CPPFLAGS $INCLUDES -DHAVE_UUID"
diff -up uuid-1.2.0/uuid.c.orig uuid-1.2.0/uuid.c
--- uuid-1.2.0/uuid.c.orig	2020-10-06 12:50:46.000000000 +0200
+++ uuid-1.2.0/uuid.c	2024-09-30 13:56:33.329669413 +0200
@@ -27,6 +27,15 @@
 
 #ifdef HAVE_UUID
 
+#if defined(uuid_time)
+/* workround with define uuid_time uuid_time64 */
+/* Also see https://bugzilla.redhat.com/2315645 */
+#undef uuid_time
+#if !defined(HAVE_UUID_TIME64)
+extern time_t uuid_time(const uuid_t uu, struct timeval *ret_tv);
+#endif
+#endif
+
 #if PHP_VERSION_ID < 80000
 #define VALUE_ERROR(n,name,msg) php_error_docref(NULL, E_WARNING, "Argument #%d (%s) %s", n, name, msg); RETURN_FALSE
 #define RETURN_THROWS() return
@@ -374,7 +383,11 @@ PHP_FUNCTION(uuid_time)
 		VALUE_ERROR(1, "$uuid", "UUID DCE TIME expected");
 	}
 
+#if defined(HAVE_UUID_TIME64)
+	RETURN_LONG(uuid_time64(u, NULL));
+#else
 	RETURN_LONG(uuid_time(u, NULL));
+#endif
 }
 /* }}} uuid_time */