Changeset 133


Ignore:
Timestamp:
Dec 3, 2006, 9:37:54 AM (19 years ago)
Author:
cinc
Message:

Added initialization call for garbage collector.

Location:
trunk/emx-wrapper
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/emx-wrapper/makefile.emx

    r98 r133  
    1010GCCLDFLAGS      =       -Zmt
    1111
    12 OBJDIR  =       .
     12OBJDIR          =       ./../../../o
    1313CDIR    =       .
     14
     15GCLIB           =       -l$(OBJDIR)/gc
    1416
    1517OBJECTS         =       voyager-desktop.o
     
    1921
    2022voyager-desktop.exe:    voyager-desktop.c
    21         $(CC)  -o $@ voyager-desktop.c $(LIBS) $(GCCFLAGS)
     23        $(CC)  -o $@ voyager-desktop.c $(LIBS) $(GCLIB) $(GCCFLAGS)
    2224
    2325
  • trunk/emx-wrapper/voyager-desktop.c

    r98 r133  
    4848  HMODULE hModule;
    4949  HMODULE hModuleGTK;
     50  HMODULE hModuleGC;
    5051  PFN proc;
    5152
     53  /*
     54    Initialize the garbage collector.
     55   */
     56  if((rc=DosLoadModule(uchrError, sizeof(uchrError),"vdesktop.dll", &hModuleGC))!=NO_ERROR)
     57    {
     58      printf("DosLoadmodule for vdesktop.dll failed with rc=0x%x because of module %s.\n", (int)rc, uchrError);
     59      return 1;
     60    };
     61  fprintf(stderr, "DLL handle for Vdesktop.dll is: 0x%x\n", (int)hModuleGC);
     62  if((rc = DosQueryProcAddr(hModuleGC,                  /* Handle to module           */
     63                            0L,                         /* No ProcName specified      */
     64                            "initGarbageCollection",    /* ProcName (not specified)   */
     65                            &proc))!=NO_ERROR)          /* Address returned           0 */
     66    {
     67       fprintf(stderr, "DosQueryProcAddr for initGarbageCollection() failed with rc=0x%x\n",(int) rc);
     68      return 1;
     69    }
     70  fprintf(stderr, "   Proc address for initGarbageCollection() is: 0x%x\n", (int)proc);
     71  proc();
     72
     73  /*
     74    Init GTK
     75   */
    5276  if((rc=DosLoadModule(uchrError, sizeof(uchrError),"gtk2.dll", &hModuleGTK))!=NO_ERROR)
    5377    {
     
    5680    };
    5781  fprintf(stderr, "DLL handle for gtk2.dll is: 0x%x\n", (int) hModuleGTK);
    58   if((rc = DosQueryProcAddr(hModuleGTK,         /* Handle to module           */
    59                         0L,                  /* No ProcName specified      */
    60                         "gtk_init"    ,                 /* ProcName (not specified)   */
    61                             &proc))!=NO_ERROR)         /* Address returned           0 */
     82  if((rc = DosQueryProcAddr(hModuleGTK,                /* Handle to module           */
     83                            0L,                        /* No ProcName specified      */
     84                            "gtk_init",                /* ProcName (not specified)   */
     85                            &proc))!=NO_ERROR)         /* Address returned         0 */
    6286    {
    6387       fprintf(stderr, "DosQueryProcAddr for gtk_init() failed with rc=0x%x\n",(int) rc);
    64        DosFreeModule(hModule);
     88       DosFreeModule(hModuleGC);
    6589      return 1;
    6690    }
     
    78102    };
    79103  fprintf(stderr, "DLL handle for Vdesktop.dll is: 0x%x\n", (int)hModule);
    80   if((rc = DosQueryProcAddr(hModule,         /* Handle to module           */
    81                         0L,                  /* No ProcName specified      */
    82                         "main_loop"    ,                 /* ProcName (not specified)   */
    83                             &proc))!=NO_ERROR)         /* Address returned           0 */
     104  if((rc = DosQueryProcAddr(hModule,                /* Handle to module           */
     105                            0L,                     /* No ProcName specified      */
     106                            "main_loop"    ,        /* ProcName (not specified)   */
     107                            &proc))!=NO_ERROR)      /* Address returned           0 */
    84108    {
    85109       fprintf(stderr, "DosQueryProcAddr for main_loop() failed with rc=0x%x\n",(int) rc);
    86        DosFreeModule(hModule);
     110       DosFreeModule(hModuleGTK);
     111       DosFreeModule(hModuleGC);
    87112      return 1;
    88113    }
     
    97122  DosFreeModule(hModuleGTK);
    98123
     124  DosFreeModule(hModuleGC);
     125
    99126  return 0;
    100127}
Note: See TracChangeset for help on using the changeset viewer.