[comp.windows.x] SYSV shared Xaw and XtInheritTranslations

doyle@ingr.com (Doyle Davidson) (05/04/90)

I am attempting to make libXaw.a a shared library under 
SYSV 3.1 and I have hit a stumper.  (I already got Xlib and Xt done)
My problem is that XtInheritTranslations is defined as:

externalref int _XtInheritTranslations;
#define XtInheritTranslations  ((String) &_XtInheritTranslations)

and later used as:

BlahClassRec blahClassRec = {
    ...,
     /* tm_table         */      XtInheritTranslations,
    ...

Is the reason that is done as opposed to something like
    #define XtInheritTranslations  -1
so that the item is truly a data pointer to prevent problems
for certain architectures?  And if so, does anyone see any problem
with me changing it for my libraries and binaries?

I can't import the address of an extern data item into my shared library
and place it in initialize data (see AsciiText.c) 

Thanks in advance,

Doyle
-------------------------------
Doyle C. Davidson              
Intergraph Corp.               
Workstation Graphics Standards 
1 Madison Industrial Park      
Huntsville, AL 35806           
(205) 730-2000                 
                               
..!uunet!ingr!doyle 
    or   doyle@ingr.com
-------------------------------

swick@ATHENA.MIT.EDU (Ralph Swick) (05/08/90)

> externalref int _XtInheritTranslations;
> #define XtInheritTranslations  ((String) &_XtInheritTranslations)
> ...
> Is the reason that is done as opposed to something like
>     #define XtInheritTranslations  -1
> so that the item is truly a data pointer to prevent problems
> for certain architectures?

Yes, and also because according to ANSI C there seems to be only
one portable (integer) pointer constant with a defined value (0)
and we need a second unique constant.

> does anyone see any problem
> with me changing it for my libraries and binaries?

No problem; you're certainly allowed to use any architecture-specific
knowledge you may have.  Other small positive integers are probably
preferable to -1 though.