From: <dan...@us...> - 2009-04-10 10:06:43
|
Revision: 1229 http://cegcc.svn.sourceforge.net/cegcc/?rev=1229&view=rev Author: dannybackx Date: 2009-04-10 10:06:28 +0000 (Fri, 10 Apr 2009) Log Message: ----------- Input by Marcel Smit, see bug #2750052. Modified Paths: -------------- trunk/cegcc/src/w32api/ChangeLog.ce trunk/cegcc/src/w32api/include/kfuncs.h Modified: trunk/cegcc/src/w32api/ChangeLog.ce =================================================================== --- trunk/cegcc/src/w32api/ChangeLog.ce 2009-04-07 18:46:40 UTC (rev 1228) +++ trunk/cegcc/src/w32api/ChangeLog.ce 2009-04-10 10:06:28 UTC (rev 1229) @@ -1,3 +1,9 @@ +2009-04-10 Marcel Smit <mar...@us...> + + * include/kfuncs.h (TlsAlloc, TlsFree, PulseEvent, ResetEvent, + SetEvent, GetCurrentThread, GetCurrentProcess, GetCurrentThreadId, + GetCurrentProcessId) : Change them from macros to inline functions. + 2009-02-07 Pedro Alves <ped...@us...> Merge from upstream. Now at 3.12. Modified: trunk/cegcc/src/w32api/include/kfuncs.h =================================================================== --- trunk/cegcc/src/w32api/include/kfuncs.h 2009-04-07 18:46:40 UTC (rev 1228) +++ trunk/cegcc/src/w32api/include/kfuncs.h 2009-04-10 10:06:28 UTC (rev 1229) @@ -21,12 +21,27 @@ #define SH_CURPROC 2 /* Process/Thread ID Methods */ -#define GetCurrentThread() ((HANDLE)(SH_CURTHREAD+SYS_HANDLE_BASE)) -#define GetCurrentProcess() ((HANDLE)(SH_CURPROC+SYS_HANDLE_BASE)) -#define GetCurrentThreadId() ((DWORD)(((HANDLE *)(PUserKData+SYSHANDLE_OFFSET))[SH_CURTHREAD])) -#define GetCurrentProcessId() ((DWORD)(((HANDLE *)(PUserKData+SYSHANDLE_OFFSET))[SH_CURPROC])) +inline HANDLE GetCurrentProcess() +{ + return ((HANDLE)(SH_CURPROC+SYS_HANDLE_BASE)); +} +inline HANDLE GetCurrentThread() +{ + return ((HANDLE)(SH_CURTHREAD+SYS_HANDLE_BASE)); +} + +inline DWORD GetCurrentThreadId() +{ + return ((DWORD)(((HANDLE *)(PUserKData+SYSHANDLE_OFFSET))[SH_CURTHREAD])); +} + +inline DWORD GetCurrentProcessId() +{ + return ((DWORD)(((HANDLE *)(PUserKData+SYSHANDLE_OFFSET))[SH_CURPROC])); +} + /* EventModify signature hinted on: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcehardware5/html/wce50lrfCeLogImportTable.asp @@ -37,16 +52,38 @@ #define EVENT_PULSE 1 #define EVENT_RESET 2 #define EVENT_SET 3 -#define PulseEvent(x) EventModify(x, EVENT_PULSE) -#define ResetEvent(x) EventModify(x, EVENT_RESET) -#define SetEvent(x) EventModify(x, EVENT_SET) +inline BOOL PulseEvent (HANDLE x) +{ + return EventModify(x, EVENT_PULSE); +} + +inline BOOL ResetEvent (HANDLE x) +{ + return EventModify(x, EVENT_PULSE); +} + +inline BOOL SetEvent (HANDLE x) +{ + return EventModify(x, EVENT_PULSE); +} + /* TLS Constants and Constructs */ #define TLS_FUNCALLOC 0 #define TLS_FUNCFREE 1 WINBASEAPI DWORD WINAPI TlsCall(DWORD func, DWORD val); -#define TlsAlloc() (TlsCall(TLS_FUNCALLOC, 0)) -#define TlsFree(x) (TlsCall(TLS_FUNCFREE, x)) +inline DWORD TlsAlloc (void) +{ + return (TlsCall(TLS_FUNCALLOC, 0)); +} + +inline BOOL WINAPI TlsFree(DWORD x) +{ + return (TlsCall(TLS_FUNCFREE, x)); +} + #endif + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |