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 / OS / Layer / Sources / FWOSInit.cpp < prev    next >
Encoding:
Text File  |  1995-11-08  |  2.7 KB  |  106 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWOSInit.cpp
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWCFMRES_H
  11. #include "FWCFMRes.h"
  12. #endif
  13.  
  14. #ifdef FW_DEBUG
  15.     #ifndef FWEVENTU_H
  16.     #include "FWEventU.h"
  17.     #endif
  18. #endif
  19.  
  20. #ifndef FWGRINIT_H
  21. #include "FWGrInit.h"
  22. #endif
  23.  
  24. #ifndef __CODEFRAGMENTS__
  25. #include <CodeFragments.h>
  26. #endif
  27.  
  28. #ifndef __SCRAP__
  29. #include <Scrap.h>
  30. #endif
  31.  
  32. //========================================================================================
  33. // Runtime Informations
  34. //========================================================================================
  35.  
  36. #ifdef FW_BUILD_MAC
  37. #pragma segment FWOSInit
  38. #endif
  39.  
  40. //========================================================================================
  41. // Prototypes
  42. //========================================================================================
  43.  
  44. #if defined(SYMANTEC_CPLUS) && defined(FW_BUILD_MAC)
  45.     #define FW_OSCFMINIT PartCFMInit
  46.     #define FW_OSSOMInit main
  47.     #if !FW_LIB_EXPORT_PRAGMAS
  48.         #pragma internal on
  49.     #endif
  50. #endif
  51.  
  52. SOMEXTERN void SOMLINK FW_OSSOMInit (long, long, string );
  53. extern "C" pascal OSErr FW_OSCFMINIT (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_OSSOMInit
  69. //----------------------------------------------------------------------------------------
  70.  
  71. SOMEXTERN void SOMLINK FW_OSSOMInit (long majorVersion, 
  72.                                        long minorVersion, 
  73.                                        string className)
  74. {
  75. }
  76.  
  77. //----------------------------------------------------------------------------------------
  78. // FW_OSCFMINIT
  79. //----------------------------------------------------------------------------------------
  80.  
  81. extern "C" pascal OSErr FW_OSCFMINIT (CFragInitBlockPtr initBlkPtr)
  82. {
  83. #ifdef FW_DEBUG
  84.     if (::FW_IsCommandKeyPressed())
  85.         DebugStr("\p FW_OSCFMINIT");
  86. #endif
  87.     
  88.     // Shared libraries don't get there static objects initialized correctly without
  89.     // calling __sinit or __CPlusInit for MetroWerks or MrC respectively.
  90.  
  91. #if GENERATINGPOWERPC
  92. #ifdef __MWERKS__
  93.     __sinit();
  94. #elif defined __MRC__
  95.     __CPlusInit();
  96. #endif
  97. #endif
  98.  
  99.     OSErr err = InitLibraryResources(initBlkPtr);
  100.     
  101.     if (err == noErr)
  102.         InitGraphic();
  103.     
  104.     return err;
  105. }
  106.