• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 517
  • Last Modified:

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!
0
Daniel Van Der Werken
Asked:
Daniel Van Der Werken
1 Solution
 
Daniel Van Der WerkenIndependent ConsultantAuthor Commented:
Just a note:

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!
0
 
cwwkieCommented:
Because you cannot share binaries between different platforms, it does not matter which calling convention you use. For each platform you have to recompile. The only thing you need to take care about is compiling all code on a platform with the same settings. Otherwise you will get either linker errors, or your program will simply crash.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now