Daniel Van Der Werken
asked on
What are _Optlink and _System
Okay. I hate to admit it, but I'm a one-platform kind of guy. Most of my programming has been on Windows.
I'm trying to build some code that seems cross-platform. AIX, OS/2, Windows.
I even went from Visual Studio 2005 back to Visual Studio 6.0 just to make working with this code easier. Seems Microsoft made a lot of core changes to the basics in this last release.
Anyway, I'm getting the following error:
error C2146: syntax error : missing ';' before identifier 'AhiInsItemImage'
So, I define __WINDOWS__ in my project settings and that seems okay. However, I can't figure out exactly why I'm getting this error.
#if defined(__OS2__)
#define AHIITPTY_API _System
#elif defined(__WINDOWS__)
#define AHIITPTY_API _System
#else
#define AHIITPTY_API
#endif
unsigned long AHIITPTY_API AhiInsItemImage(
unsigned short count,
AHIITIMG ReqList[] );
Obviously, AHITPTY_API isn't defined properly. I Googled (it's a verb now, I think) _System but there's a lot of chaff there to go through. Heck, why do I have all of these expert points myself if I can't ask a question now and then?
Anyone able to help me out here? I know we're defining an API call, but I'm not sure what the basis is, etc.
Thanks!
I'm trying to build some code that seems cross-platform. AIX, OS/2, Windows.
I even went from Visual Studio 2005 back to Visual Studio 6.0 just to make working with this code easier. Seems Microsoft made a lot of core changes to the basics in this last release.
Anyway, I'm getting the following error:
error C2146: syntax error : missing ';' before identifier 'AhiInsItemImage'
So, I define __WINDOWS__ in my project settings and that seems okay. However, I can't figure out exactly why I'm getting this error.
#if defined(__OS2__)
#define AHIITPTY_API _System
#elif defined(__WINDOWS__)
#define AHIITPTY_API _System
#else
#define AHIITPTY_API
#endif
unsigned long AHIITPTY_API AhiInsItemImage(
unsigned short count,
AHIITIMG ReqList[] );
Obviously, AHITPTY_API isn't defined properly. I Googled (it's a verb now, I think) _System but there's a lot of chaff there to go through. Heck, why do I have all of these expert points myself if I can't ask a question now and then?
Anyone able to help me out here? I know we're defining an API call, but I'm not sure what the basis is, etc.
Thanks!
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
I replaced _System with __stdcall and it compiles, but I'm not sure that's the best calling convention to us. Should I use __cdecl instead? One cleans up the stack by itself and one doesn't. I'm thinking perhaps __cdecl is a better choice for cross-platform code. Any ideas?
Thanks!