libfreerdp-primitives: fix build on Mac OS X

This commit is contained in:
Marc-André Moreau
2013-01-19 20:32:14 -05:00
parent f38bc6d393
commit 151c2a63e4
5 changed files with 26 additions and 9 deletions

View File

@@ -80,7 +80,7 @@ endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "FreeRDP/libfreerdp")
if(BUILD_TESTING AND (NOT WIN32))
if(BUILD_TESTING AND ((NOT WIN32) AND (NOT APPLE)))
add_subdirectory(test)
endif()

View File

@@ -61,10 +61,12 @@ static primitives_t* pPrimitives = NULL;
#endif
/* If GCC */
# ifdef __GNUC__
#ifdef __GNUC__
# define xgetbv(_func_, _lo_, _hi_) \
#ifdef __AVX__
#define xgetbv(_func_, _lo_, _hi_) \
__asm__ __volatile__ ("xgetbv" : "=a" (_lo_), "=d" (_hi_) : "c" (_func_))
#endif
static void cpuid(
unsigned info,
@@ -118,6 +120,7 @@ static void set_hints(primitives_hints_t* hints)
if (c & C_BIT_SSE42)
hints->x86_flags |= PRIM_X86_SSE42_AVAILABLE;
#ifdef __AVX__
if ((c & C_BITS_AVX) == C_BITS_AVX)
{
int e, f;
@@ -134,14 +137,20 @@ static void set_hints(primitives_hints_t* hints)
}
}
/* TODO: AVX2: set eax=7, ecx=0, cpuid, check ebx-bit5 */
#endif
}
# else
#else
static void set_hints(primitives_hints_t* hints)
{
/* x86 non-GCC: TODO */
}
# endif /* __GNUC__ */
#endif /* __GNUC__ */
/* ------------------------------------------------------------------------- */
#elif defined(__arm__) || defined(__ARM_ARCH_7A__) \
|| defined(__ARM_EABI__) || defined(__ARMEL__) || defined(ANDROID)
#ifndef __arm__

View File

@@ -107,7 +107,7 @@ WINPR_API BOOL CreateProcessAsUserW(HANDLE hToken, LPCWSTR lpApplicationName, LP
WINPR_API VOID ExitProcess(UINT uExitCode);
WINPR_API HANDLE GetCurrentProcess(VOID);
WINPR_API HANDLE _GetCurrentProcess(VOID);
WINPR_API DWORD GetCurrentProcessId(VOID);
WINPR_API BOOL TerminateProcess(HANDLE hProcess, UINT uExitCode);
@@ -125,7 +125,7 @@ WINPR_API HANDLE CreateRemoteThread(HANDLE hProcess, LPSECURITY_ATTRIBUTES lpThr
WINPR_API VOID ExitThread(DWORD dwExitCode);
WINPR_API HANDLE GetCurrentThread(VOID);
WINPR_API HANDLE _GetCurrentThread(VOID);
WINPR_API DWORD GetCurrentThreadId(VOID);
WINPR_API DWORD ResumeThread(HANDLE hThread);
@@ -147,6 +147,14 @@ WINPR_API LPVOID TlsGetValue(DWORD dwTlsIndex);
WINPR_API BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue);
WINPR_API BOOL TlsFree(DWORD dwTlsIndex);
#else
/*
* GetCurrentProcess / GetCurrentThread cause a conflict on Mac OS X
*/
#define _GetCurrentProcess GetCurrentProcess
#define _GetCurrentThread GetCurrentThread
#endif
#endif /* WINPR_THREAD_H */

View File

@@ -92,7 +92,7 @@ VOID ExitProcess(UINT uExitCode)
}
HANDLE GetCurrentProcess(VOID)
HANDLE _GetCurrentProcess(VOID)
{
return NULL;
}

View File

@@ -128,7 +128,7 @@ VOID ExitThread(DWORD dwExitCode)
pthread_exit((void*) dwExitCode);
}
HANDLE GetCurrentThread(VOID)
HANDLE _GetCurrentThread(VOID)
{
return NULL;
}