To allow your header files to be used by ILE C and ILE C++ compilers, all functions with "OS" linkage type require dual prototypes, as shown in the following figure:
#ifdef __cplusplus extern "linkage-type" //linkage type "OS" #else #pragma linkage(function_name,linkage_type) #endif void function_name(...); |
If you have a list of functions that need dual prototypes, you can use the syntax shown in the following figure:
#ifdef __cplusplus extern "linkage-type" { //linkage type "OS" #else #pragma linkage(function_name1, linkage_type) . . #pragma linkage(function_nameN, linkage_type) #endif void function_name1(...); . . void function_nameN(...); #ifdef __cplusplus } #endif |
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.