Re: TBRIK inheritance

From: Valery Fine (fine@mail.cern.ch)
Date: Fri Nov 21 1997 - 16:35:03 MET


On 21 Nov 97 at 13:40, Nick van Eijndhoven wrote:

> Hi Valery,
> Could you try "cl /Za /LD /MD ....." in which case NO C++ extensions
> are accepted. Maybe this will give you the warnings. To my opinion
> one should always use the 'strict ANSI requirement' in order to be
> able to transport the code to different platforms.

   No I can NOT apply this since this class is derived from TShape 
one and involves 3 ROOT global pointers, namely: gNode, gSize3D and 
gPad. All of these 3 pointers are defined within two other DLLs. To 
access them the program MUST define these variables as follows:

/*Z,+PATCH,//ROOT/INCLUDE.*/
/*Z,+KEEP,DllImport,T=C..*/
/*CMZ :  0.90/10 05/12/96  12.35.16  by  Valery Fine(fine@vxcern.cern.ch)*/
/*-- Author :    Valery Fine(fine@vxcern.cern.ch)   17/09/96*/

/*
  This include file defines DllImport/DllExport macro
  to build DLLs under Windows OS.

  They are defined as dummy for UNIX's
*/

#ifndef ROOT_DllImport
#define ROOT_DllImport

#ifndef __CINT__
#if defined(WIN32) && defined(_DLL)
#  define DllImport     __declspec( dllimport )
#  define DllExport     __declspec( dllexport )
#else
#  define DllImport
#  define DllExport
#endif
#  define EXTERN       DllImport extern
#endif


#endif


  where   "__declspec( dllimport )" and   "__declspec( dllexport )" 
both are very Microsoft EXTENSIONs which I CAN NOT disable. Sorry.


  By the way this means if anyone WANTs to create his own C++ 
class and some global variable pointing this class and want to see 
this variable ACROSS several DLLs (under Windows) he MUST apply the 
same macro, namely instead of C++

  extern <variable>

MUST be

  EXTERN <variable>

where EXTERN is a macro defined above.

  If someone knows (I would not say *standard* since usually for 
UNIX-world this word is a nick-name of the UNIX) but an UNIVERSAL 
solution I'll appreciate it and will introduce this immediately

  With my best regards,
                                    Valery
Dr. Valeri Faine (Valery Fine)
    ------------ -------------   Phone: +41 22 767 4921
CERN                             FAX  : +41 22 767 7155
CH-1211 Geneva, 23               mailto:fine@mail.cern.ch 
Switzerland                      http://nicewww.cern.ch/~fine
                                 



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:22 MET