home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Found / Layer / Sources / FWFoundI.cpp next >
Encoding:
Text File  |  1995-11-08  |  2.9 KB  |  105 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWFoundI.cpp
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    (c) 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWENVDEF_H
  11. #include "FWEnvDef.h"
  12. #endif
  13.  
  14. #ifndef som_h
  15. #include <som.h>
  16. #endif
  17.  
  18. #ifndef __CODEFRAGMENTS__
  19. #include <CodeFragments.h>
  20. #endif
  21.  
  22. #ifndef FWPRIDEB_H
  23. #include "FWPriDeb.h"
  24. #endif
  25.  
  26. #ifdef FW_DEBUG
  27. #if defined(FW_BUILD_MAC) && !defined(__EVENTS__)
  28. #include <Events.h>
  29. #endif
  30. #endif
  31.  
  32. //========================================================================================
  33. // Runtime Informations
  34. //========================================================================================
  35.  
  36. #ifdef FW_BUILD_MAC
  37. #pragma segment framework
  38. #endif
  39.  
  40. //========================================================================================
  41. // Prototypes
  42. //========================================================================================
  43.  
  44. #if defined(SYMANTEC_CPLUS) && defined(FW_BUILD_MAC)
  45.     #define FW_FOUNDCFMINIT PartCFMInit
  46.     #define FW_FoundSOMInit main
  47.     #if !FW_LIB_EXPORT_PRAGMAS
  48.     #pragma internal on
  49.     #endif
  50. #endif
  51.  
  52. SOMEXTERN void SOMLINK FW_FoundSOMInit (long, long, string );
  53. extern "C" pascal OSErr FW_FOUNDCFMINIT (CFragInitBlockPtr initBlkPtr);
  54.  
  55. #if GENERATINGPOWERPC
  56. #ifdef __MWERKS__
  57. extern "C" void __sinit();
  58. #elif defined __MRC__
  59. extern "C" void __CPlusInit();
  60. #endif
  61. #endif
  62.  
  63. //========================================================================================
  64. // Initialization functions
  65. //========================================================================================
  66.  
  67. //----------------------------------------------------------------------------------------
  68. // FW_FoundSOMInit
  69. //----------------------------------------------------------------------------------------
  70.  
  71. SOMEXTERN void SOMLINK FW_FoundSOMInit (long majorVersion, 
  72.                                        long minorVersion, 
  73.                                        string className)
  74. {
  75. }
  76.  
  77. //----------------------------------------------------------------------------------------
  78. // FW_FOUNDCFMINIT
  79. //----------------------------------------------------------------------------------------
  80.  
  81. extern "C" pascal OSErr FW_FOUNDCFMINIT (CFragInitBlockPtr initBlkPtr)
  82. {
  83. #ifdef FW_DEBUG
  84.     // [HLX] can't use FW_IsCommandKeyPressed because in OS Layer
  85.     KeyMap theKeyMap;
  86.     ::GetKeys(theKeyMap);
  87.     const unsigned char *theKeys = (const unsigned char *) theKeyMap;
  88.     if ((theKeys[0x37 >> 3] >> (0x37 & 7)) & 1)
  89.         DebugStr("\pFW_FOUNDCFMINIT");
  90. #endif
  91.     
  92.     // Shared libraries don't get there static objects initialized correctly without
  93.     // calling __sinit or __CPlusInit for MetroWerks or MrC respectively.
  94.  
  95. #if GENERATINGPOWERPC
  96. #ifdef __MWERKS__
  97.     __sinit();
  98. #elif defined __MRC__
  99.     __CPlusInit();
  100. #endif
  101. #endif
  102.     
  103.     return noErr;
  104. }
  105.