summaryrefslogtreecommitdiffstats
path: root/sal
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-01-05 13:18:25 +0100
committerMichael Stahl <mstahl@redhat.com>2012-01-05 13:19:08 +0100
commit8b898fb94ead6f698b2e2a0b551cf78c6bd62512 (patch)
treed609de3a5c3685c14e64b1e7e91066ae7dfb4442 /sal
parentminor idl fixes (diff)
downloadcore-8b898fb94ead6f698b2e2a0b551cf78c6bd62512.tar.gz
core-8b898fb94ead6f698b2e2a0b551cf78c6bd62512.zip
sal: try to fix MinGW min/max breakage by inlining
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/w32/security.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sal/osl/w32/security.c b/sal/osl/w32/security.c
index 053d39f446c1..2ae86850b440 100644
--- a/sal/osl/w32/security.c
+++ b/sal/osl/w32/security.c
@@ -368,12 +368,14 @@ sal_Bool SAL_CALL osl_getUserIdent(oslSecurity Security, rtl_uString **strIdent)
DWORD dwSidRev=SID_REVISION;
DWORD dwCounter;
DWORD dwSidSize;
+ PUCHAR pSSACount;
/* obtain SidIdentifierAuthority */
psia=GetSidIdentifierAuthority(pSid);
/* obtain sidsubauthority count */
- dwSubAuthorities=min(*GetSidSubAuthorityCount(pSid), 5);
+ pSSACount = GetSidSubAuthorityCount(pSid);
+ dwSubAuthorities = (*pSSACount < 5) ? *pSSACount : 5;
/* buffer length: S-SID_REVISION- + identifierauthority- + subauthorities- + NULL */
Ident=malloc(88*sizeof(sal_Char));
@@ -424,7 +426,10 @@ sal_Bool SAL_CALL osl_getUserIdent(oslSecurity Security, rtl_uString **strIdent)
sal_Unicode *Ident;
WNetGetUserA(NULL, NULL, &needed);
- needed = max( 16 , needed );
+ if (needed < 16)
+ {
+ needed = 16;
+ }
Ident=malloc(needed*sizeof(sal_Unicode));
if (WNetGetUserW(NULL, Ident, &needed) != NO_ERROR)