--- include/libsmb2-private.h 2024-12-23 11:38:55.000000000 +0800 +++ include/libsmb2-private.h 2026-08-22 12:16:24.000000000 +0800 @@ -24,11 +24,7 @@ #endif #ifdef HAVE_LIBKRB5 -#if __APPLE__ -#import -#else #include -#endif /* __APPLE__ */ #endif /* HAVE_LIBKRB5 */ #define MIN(a,b) (((a)<(b))?(a):(b)) --- lib/krb5-wrapper.h 2024-12-23 11:38:55.000000000 +0800 +++ lib/krb5-wrapper.h 2026-08-22 12:24:37.000000000 +0800 @@ -32,15 +32,11 @@ extern "C" { #endif -#if __APPLE__ -#import -#else #include static const gss_OID_desc gss_mech_spnego = { 6, "\x2b\x06\x01\x05\x05\x02" }; -#endif static const gss_OID_desc spnego_mech_krb5 = { 9, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02" --- lib/krb5-wrapper.c 2024-12-23 11:38:55.000000000 +0800 +++ lib/krb5-wrapper.c 2026-08-22 12:34:16.000000000 +0800 @@ -58,12 +58,9 @@ #endif #include -#if __APPLE__ -#include -#else #include #include -#endif + #include #include "compat.h" @@ -221,20 +218,12 @@ /* TODO: the proper mechanism (SPNEGO vs NTLM vs KRB5) should be * selected based on the SMB negotiation flags */ - #ifdef __APPLE__ - auth_data->mech_type = GSS_SPNEGO_MECHANISM; - #else auth_data->mech_type = &gss_mech_spnego; - #endif auth_data->cred = GSS_C_NO_CREDENTIAL; /* Create creds for the user */ mechOidSet.count = 1; - #ifdef __APPLE__ - mechOidSet.elements = discard_const(GSS_SPNEGO_MECHANISM); - #else mechOidSet.elements = discard_const(&gss_mech_spnego); - #endif if (smb2->use_cached_creds) { krb5_error_code ret = 0; @@ -283,7 +272,6 @@ return NULL; } - #ifndef __APPLE__ /* gss_set_neg_mechs is not defined on macOS/iOS. */ if (smb2->sec != SMB2_SEC_UNDEFINED) { gss_OID_set_desc wantMech; @@ -300,7 +288,6 @@ return NULL; } } - #endif if (nc_password) { free(nc_password);