From 21491d9a822433c42b031b173bf0015a3122d084 Mon Sep 17 00:00:00 2001 From: Mark Vitale Date: Mon, 4 Nov 2024 12:39:32 -0500 Subject: [PATCH] Restore max() macro for Heimdal Commit de46edef693d (Remove lowercase min/max macro definitions) inadvertently removed a definition of max() that is required by _krb5_n_fold() (src/external/heimdal/krb5/n-fold.c) if no system definition of max() is available. For example, on Solaris this results in a kernel module with an undefined external symbol 'max', which prevents the kernel module from loading: genunix: [ID 819705 kern.notice] /kernel/drv/amd64/afs: undefined symbol genunix: [ID 826211 kern.notice] 'max' genunix: [ID 472681 kern.notice] WARNING: mod_load: cannot load module 'afs' Restore the required max() macro definition. Change-Id: I6bca2bb2b90d7cdbe90a3b769997cdc153f59f6c Reviewed-on: https://gerrit.openafs.org/15874 Tested-by: BuildBot Reviewed-by: Cheyenne Wills Reviewed-by: Andrew Deason --- src/crypto/rfc3961/krb5_locl.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/crypto/rfc3961/krb5_locl.h b/src/crypto/rfc3961/krb5_locl.h index e575084fcf..04292eefaf 100644 --- a/src/crypto/rfc3961/krb5_locl.h +++ b/src/crypto/rfc3961/krb5_locl.h @@ -66,6 +66,10 @@ #define ALLOC(X, N) (X) = calloc((N), sizeof(*(X))) +#ifndef max +#define max(a,b) (((a)>(b))?(a):(b)) +#endif + #ifndef O_BINARY #define O_BINARY 0 #endif