home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / palmos / wapuniverse-src-0.3.5.build9.tar.gz / wapuniverse-src-0.3.5.build9.tar / wapuniverse-0.3.5.build9 / callbacks.h < prev    next >
C/C++ Source or Header  |  2000-11-12  |  848b  |  25 lines

  1. #ifndef __CALLBACK_H__
  2. #define __CALLBACK_H__
  3.  
  4. /* This is a workaround for a bug in the current version of gcc:
  5.    gcc assumes that no one will touch %a4 after it is set up in crt0.o.
  6.    This isn't true if a function is called as a callback by something
  7.    that wasn't compiled by gcc (like FrmCloseAllForms()).  It may also
  8.    not be true if it is used as a callback by something in a different
  9.    shared library.
  10.    We really want a function attribute "callback" which will insert this
  11.    progloue and epilogoue automatically.
  12. - Ian */
  13.  
  14. register void *reg_a4 asm("%a4");
  15.  
  16. /* NO LONGER NEEDED IF USING PRC_TOOLS 2
  17. #define CALLBACK_PROLOGUE \
  18.   void *save_a4 = reg_a4; asm("move.l %%a5,%%a4; sub.l #edata,%%a4" : :);
  19. #define CALLBACK_EPILOGUE reg_a4 = save_a4;
  20. */
  21. #define CALLBACK_PROLOGUE
  22. #define CALLBACK_EPILOGUE
  23.  
  24. #endif
  25.