Porting an OS abstraction layer (from an embedded environment) to windows platform I end up with the following situation:
/* demo.c is a simple application working with some tasks */
#include "os.h"
/* os.h is needed as it has many required defines. Unfortunately it also contains */
/* extern FUNC(StatusType, OS_CODE) SetEvent(TaskType TaskID, EventMaskType Mask) */
#include <Windows.h> /* new target platform */
/* several productive code pieces call this function to signal tasks */
FUNC(StatusType, OS_CODE) SetEvent(TaskType TaskID, EventMaskType Mask)
{
if((TaskID == ...) && (Mask == ...))
{
HANDLE evNotify = ...;
SetEvent(evNotify); <-- WinAPI
}
}
Before the OS wrapper called functions like "xTaskNotify". It is now the Windows port where the abstracted function has the same name. What expectedly results in a compile error.
Are there any easy means (or ideas) how to handle this? [before I start using anonymous function pointers, etc.]
NB: of course I cannot change the OS wrapper code as user code is relying on OS wrapper "SetEvent". And also it's generated.