home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / samples / sam04l / sample04.h__ / SAMPLE04.H
Encoding:
C/C++ Source or Header  |  1992-04-01  |  2.7 KB  |  62 lines

  1. /******************************************************************************/
  2. /* SAMPLE PROGRAM 04: SAMPLE04.H                                              */
  3. /*                                                                            */
  4. /* COPYRIGHT:                                                                 */
  5. /* ----------                                                                 */
  6. /* Copyright (C) International Business Machines Corp., 1991,1992.            */
  7. /*                                                                            */
  8. /* DISCLAIMER OF WARRANTIES:                                                  */
  9. /* -------------------------                                                  */
  10. /* The following [enclosed] code is sample code created by IBM                */
  11. /* Corporation.  This sample code is not part of any standard IBM product     */
  12. /* and is provided to you solely for the purpose of assisting you in the      */
  13. /* development of your applications.  The code is provided "AS IS",           */
  14. /* without warranty of any kind.  IBM shall not be liable for any damages     */
  15. /* arising out of your use of the sample code, even if they have been         */
  16. /* advised of the possibility of such damages.                                */
  17. /*                                                                            */
  18. /******************************************************************************/
  19.  
  20. #ifndef __32BIT__
  21.   /*
  22.    * In 16-bit mode, remap the 32-bit-specific keywords to their 16-bit
  23.    * equivalents.  This allows this header file to be shared by both the
  24.    * 16-bit and 32-bit files.
  25.    */
  26.   #define _Seg16
  27.   #define _Far16
  28.   #define _Cdecl _cdecl
  29.   #define _Pascal _pascal
  30.   #define _Fastcall _fastcall
  31.   /*
  32.    * Define extern to be blank.  This means that all global variables will
  33.    * be "owned" by the 16-bit routine.
  34.    */
  35.   #define extern
  36. #endif
  37.  
  38. /*
  39.  * Global variables.  foo1 will be shared by the 32-bit EXE and the 16-bit
  40.  * DLL.  It is "owned" by the DLL.  The #pragma map directive causes foo1
  41.  * to be known externally as _foo1.  We do this because the 16-bit compiler
  42.  * prepends an underscore to all external names, and the 32-bit code and the
  43.  * 16-bit code have to agree on the name of the variable which is being
  44.  * shared.
  45.  */
  46.  
  47. extern char * _Seg16 foo1;
  48.  
  49. #ifdef __32BIT__
  50.   #pragma map( foo1, "_foo1" )
  51. #endif
  52.  
  53.  
  54. /*
  55.  * Prototypes.  The C Set/2-specific keywords have been translated to their
  56.  * 16-bit equivalents for 16-bit compiles by the #defines above.
  57.  */
  58.  
  59. extern void _Far16            plugh1( void );
  60. extern void _Far16 _Pascal    plugh2( char * _Seg16 * );
  61. extern void _Far16 _Cdecl     plugh3( void (* _Far16 _Pascal)( void ) );
  62.