Ignore:
Timestamp:
Apr 9, 2008, 10:22:08 PM (17 years ago)
Author:
cinc
Message:

Portability patches for Windows, Linux, Darwin by Bird.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nom/class_c/nomcls.c

    r294 r326  
    4040#endif
    4141
    42 #define INCL_DOS
    43 #include <os2.h>
     42#ifdef __OS2__
     43# define INCL_DOS
     44# include <os2.h>
     45#endif /* __OS2__ */
     46
    4447#include <string.h>
    4548#include <stdlib.h>
    46 #include <gtk/gtk.h>
     49#ifdef NOM_WITH_GTK
     50# include <gtk/gtk.h>
     51#endif
    4752
    4853
     
    6469  if(nomIsObj(nObj)){
    6570    //nomPrintf("Finalizing 0x%x: %s \n", nObj, nObj->mtab->nomClassName);
    66     _nomUnInit(nObj, NULLHANDLE);
     71    _nomUnInit(nObj, NULL);
    6772  }
    6873  //else
     
    8085
    8186  if(!_ncpObject)
    82     return NULLHANDLE;
     87    return NULL;
    8388
    8489  ncp=(NOMClassPriv*)_ncpObject;
     
    8691  /* Allocate memory big enough to hold an object. This means the size is that of the
    8792     mtab pointer and all instance variables. */
    88   if((nObj=_nomAllocate(nomSelf, ncp->mtab->ulInstanceSize, NULLHANDLE))==NULLHANDLE)
    89     return NULLHANDLE;
     93  if((nObj=_nomAllocate(nomSelf, ncp->mtab->ulInstanceSize, NULL))==NULL)
     94    return NULL;
    9095
    9196  /* _nomInit() is called in _nomRenew() */
    92   return _nomRenew(nomSelf, (CORBA_Object)nObj, NULLHANDLE); /* This will also init the object */
     97  return _nomRenew(nomSelf, (CORBA_Object)nObj, NULL); /* This will also init the object */
    9398}
    9499
     
    135140  tempEnv.fFlags=NOMENV_FLG_DONT_CHECK_OBJECT;
    136141#endif
    137   _nomRenewNoInit(nomSelf, nomObj, NULLHANDLE);
     142  _nomRenewNoInit(nomSelf, nomObj, NULL);
    138143
    139144  /* And now give the object the possibility to initialize... */
    140145  /* Make sure the object is not checked. */
    141146  //_nomInit((NOMObject*)nomObj, &tempEnv);
    142   _nomInit((NOMObject*)nomObj, NULLHANDLE);
     147  _nomInit((NOMObject*)nomObj, NULL);
    143148
    144149  return nomObj;
     
    165170
    166171  /* The private struct characterizing the objects this meta class can create. */
    167   ncp=_nomGetObjectCreateInfo(nomSelf, NULLHANDLE);
     172  ncp=_nomGetObjectCreateInfo(nomSelf, NULL);
    168173
    169174  if(!ncp)
     
    231236     
    232237      //The following was used before changing nomGetname()
    233       //if(!_nomFindClassFromName(NOMClassMgrObject, _nomGetName(nomSelf, NULLHANDLE),
    234       //                        0, 0, NULLHANDLE))
     238      //if(!_nomFindClassFromName(NOMClassMgrObject, _nomGetName(nomSelf, NULL),
     239      //                        0, 0, NULL))
    235240      if(!_nomFindClassFromName(NOMClassMgrObject, _nomGetClassName(nomSelf, &tempEnv),
    236241                              0, 0, &tempEnv))
     
    246251          //ncPriv->ulIsMetaClass=1; /* Mark that we are a metaclass */
    247252          ncPriv->ulClassFlags|=NOM_FLG_IS_METACLASS; /* Mark that we are a metaclass */
    248           _nomRegisterClass(NOMClassMgrObject, nomSelf->mtab, NULLHANDLE);
     253          _nomRegisterClass(NOMClassMgrObject, nomSelf->mtab, NULL);
    249254          /* Register all the methods this class introduces */
    250255          ulNumIntroducedMethods=ncPriv->sci->ulNumStaticMethods;
     
    253258              if(*ncPriv->sci->nomSMethods[a].chrMethodDescriptor)
    254259                _nomRegisterMethod(NOMClassMgrObject, nomSelf->mtab,
    255                                    *ncPriv->sci->nomSMethods[a].chrMethodDescriptor, NULLHANDLE);
     260                                   *ncPriv->sci->nomSMethods[a].chrMethodDescriptor, NULL);
    256261            }
    257262          /* Metaclass is registered. Register the object class this
    258263             metaclass may create. */
    259           ncPriv=(NOMClassPriv*)_nomGetObjectCreateInfo(nomSelf, NULLHANDLE);//nomSelf->mtab->nomClsInfo;
     264          ncPriv=(NOMClassPriv*)_nomGetObjectCreateInfo(nomSelf, NULL);//nomSelf->mtab->nomClsInfo;
    260265          if(ncPriv){
     266#ifndef _MSC_VER
    261267#warning !!!!! NOMClass does not have this pointer, this is a bug !!!!!
     268#endif
    262269            //ncPriv->ulIsMetaClass=0; /* Mark that we are not a metaclass (should be 0 already) */
    263270            ncPriv->ulClassFlags&=~NOM_FLG_IS_METACLASS; /* Mark that we are not a metaclass (should be 0 already) */
    264             _nomRegisterClass(NOMClassMgrObject, ncPriv->mtab, NULLHANDLE);
     271            _nomRegisterClass(NOMClassMgrObject, ncPriv->mtab, NULL);
    265272
    266273            /* Register all the methods this class introduces */
     
    270277                if(*ncPriv->sci->nomSMethods[a].chrMethodDescriptor)
    271278                  _nomRegisterMethod(NOMClassMgrObject, ncPriv->mtab,
    272                                      *ncPriv->sci->nomSMethods[a].chrMethodDescriptor, NULLHANDLE);
     279                                     *ncPriv->sci->nomSMethods[a].chrMethodDescriptor, NULL);
    273280              }/* for(a) */
    274281          }/* ncPriv */
     
    281288        nomPrintf("%s: Metaclass already registered, registering normal object class now.\n", __FUNCTION__);
    282289
    283         ncPriv=(NOMClassPriv*)_nomGetObjectCreateInfo(nomSelf, NULLHANDLE);//nomSelf->mtab->nomClsInfo;
     290        ncPriv=(NOMClassPriv*)_nomGetObjectCreateInfo(nomSelf, NULL);//nomSelf->mtab->nomClsInfo;
    284291        // ncPriv->ulIsMetaClass=0; /* Mark that we are not a metaclass (should be 0 already) */
    285292        ncPriv->ulClassFlags&=~NOM_FLG_IS_METACLASS; /* Mark that we are not a metaclass (should be 0 already) */
     
    292299              if(*ncPriv->sci->nomSMethods[a].chrMethodDescriptor)
    293300                _nomRegisterMethod(NOMClassMgrObject, ncPriv->mtab,
    294                                    *ncPriv->sci->nomSMethods[a].chrMethodDescriptor, NULLHANDLE);
     301                                   *ncPriv->sci->nomSMethods[a].chrMethodDescriptor, NULL);
    295302            }
    296303          //nomPrintf("%s %s \n", nomSelf->mtab->nomClassName, ncPriv->mtab->nomClassName);
    297           _nomRegisterClass(NOMClassMgrObject, ncPriv->mtab, NULLHANDLE);
     304          _nomRegisterClass(NOMClassMgrObject, ncPriv->mtab, NULL);
    298305        }
    299306      }
     
    316323  /* Don't check object pointer. We are just created but not yet registered as a class. */
    317324  //  NOMClass_nomInit_parent(nomSelf,  &tempEnv);
    318   NOMClass_nomInit_parent(nomSelf, NULLHANDLE);
    319 }
    320 
    321 
    322 
    323 
     325  NOMClass_nomInit_parent(nomSelf, NULL);
     326}
     327
     328
     329
     330
Note: See TracChangeset for help on using the changeset viewer.