now i have declared extern "C" globally
here is my code
Code:
/*********olux.h*********/
#ifndef _OLUX_H
#define _OLUX_H
#if WIN32
#define MY_API(ret_type) ret_type __stdcall
#else
#define MY_API(ret_type) ret_type //line 100
#endif
#if defined(__GNUC__) || #if WIN32 //line 168
#ifdef __cplusplus
extern "C"
{
#endif
MY_API(long) olpOpenPredictor(long *ohPredHandle);
#ifdef __cplusplus
}
#endif
#endif
#endif
Code:
/*******olupx.cpp*********/
MY_API(long) olpOpenPredictor( long *ohPredHandle)//this func is in global scope
{
.//here i have some code
.
}
but now im getting the error has
olupx/inc/olux.h:168:33: error: missing binary operator before token "WIN32"
im using #ifdef WIN32 in line 168 (because i need that same code to be executed on windows)
and whether it is required to use __attribute__ in line 100(i.e #define MY_API(ret_type) __attribute__ ret_type)
please suggest me to do
waiting for your reply.............