home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / OS2 / EMXFIX04.ZIP / C16TEST1.C < prev    next >
C/C++ Source or Header  |  1994-01-23  |  451b  |  24 lines

  1. /* c16test1.c (emx+gcc) */
  2.  
  3. /* Call 16-bit function linked at load time. */
  4.  
  5. #include <stdio.h>
  6. #include <os2thunk.h>
  7.  
  8. short _THUNK_C_FUNCTION (add) (short x, short y);
  9.  
  10. short add (int x, int y)
  11. {
  12.   return ((short)(_THUNK_C_PROLOG (2+2);
  13.                   _THUNK_C_SHORT (x);
  14.                   _THUNK_C_SHORT (y);
  15.                   _THUNK_C_CALL (add)));
  16. }
  17.  
  18.  
  19. int main (void)
  20. {
  21.   printf ("2+3=%d\n", add (2, 3));
  22.   return (0);
  23. }
  24.