From: Simon Wilkinson Date: Fri, 30 Mar 2012 18:09:36 +0000 (+0100) Subject: DARWIN: Make crfree() an inline function X-Git-Tag: upstream/1.6.5.2^2~8 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=59269b39b2dcc6ad9157c674b0104beecba46206;p=packages%2Fo%2Fopenafs.git DARWIN: Make crfree() an inline function On Darwin 100, we have #define crfree(X) kauth_cred_unref(&X) which expands in one place to kauth_cred_unref(&(afs_ucred_t *)avc->linkData) clang warns about this in -Werror mode, because arguments to the address-of operator must be lvalues. To fix this make crfree an inline function, which will then let us do the indirection required. Reviewed-on: http://gerrit.openafs.org/7073 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear (cherry picked from commit 1d8937b860509fcaabb041bc14faf7aa3023f3c9) Reviewed-on: http://gerrit.openafs.org/10548 Tested-by: BuildBot Reviewed-by: Stephan Wiesand (cherry picked from commit 931d1a8bea393ba3df69b163cb4d05c35f3c948e) Change-Id: Iba1def8ae4004e918185109767bd8a0f0a263813 Reviewed-on: http://gerrit.openafs.org/10607 Reviewed-by: Stephan Wiesand Tested-by: Stephan Wiesand --- diff --git a/src/afs/DARWIN/osi_machdep.h b/src/afs/DARWIN/osi_machdep.h index 5a615cbc4..ae6e02eb9 100644 --- a/src/afs/DARWIN/osi_machdep.h +++ b/src/afs/DARWIN/osi_machdep.h @@ -33,6 +33,7 @@ typedef unsigned short etap_event_t; #include #include #include +#include #endif #include @@ -104,7 +105,7 @@ enum vcexcl { EXCL, NONEXCL }; #define crref kauth_cred_get_with_ref #define crhold kauth_cred_ref #ifdef AFS_DARWIN100_ENV -#define crfree(X) kauth_cred_unref(&X) +static inline void crfree(kauth_cred_t X) { kauth_cred_unref(&X); } #else #define crfree kauth_cred_rele #endif