Hylafax Developers Mailing List Archives

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

[hylafax-devel] Re: CVS brokenness



Hi All,

Sorry to have been flooding the list

Some coffee, and I have found the problem...but I REALLY need to 
go to bed now!!

The solution is a different story...

and I must say, Robert Colquhoun is bang on the money!!

Compile Flags
-------------

The line to compile BoolArray.c++ is:

/usr/local/bin/g++ -E -I -D__ANSI_CPP__ -I. -I.. -I.././regex -I.././util \
	-I.././util -I/usr/local/include -g -O -c BoolArray.c++

** Make a Mental Note the -D__ANSI_CPP__

BoolArray.c++
-------------
Includes BoolArray.h


BoolArray.h
-----------
fxDECLARE_PrimArray(fxBoolArray, bool)


Array.h
-------
Line 231:
#define fxDECLARE_PrimArray(ARRAY,ITEM) fxDECLARE_Array(ARRAY,ITEM)

Line 227:

#define fxDECLARE_Array(ARRAY,ITEM)	\
class ARRAY : public fxArray {		\
public:                       		\
    fxArrayHeader(ARRAY,ITEM) 		\
};                            		\ 	WHICH WORKS 100 % to here
fxDECLARE_Ptr(ARRAY);			<-----  **** PROBLEM STARTS HERE


Ptr.h
-----
Line 47 of Ptr.h has the #define for fxDECLARE_Ptr(ARRAY);

Which starts:

#define fxDECLARE_Ptr(TYPE)            	\
class fxCAT(TYPE,Ptr) {			\
protected:                             	\
    void destroy() { if (p) p->dec(); }	\
    TYPE* p;                    	\
public:                         	\
    fxCAT(TYPE,Ptr)() { p = 0; }	\
..
..


Types.h
-------

Line 75 of Types.h defines 
#define fxCAT(a,b) a##b		**** __ANSI_CPP__ is defined  ****

BUT, this hasn't changed since the initial version of the HylaFAX???
What is going on???


The C Preprocessor Output
-------------------------

class      fxBoolArray       Ptr   {
protected:                                  
        void destroy() { if (p) p->dec(); } 
        fxBoolArray   * p;                  
public:                                     
        fxBoolArray       Ptr  () { p = 0; }



REAL C Preprocessor Output should be:
------------------------------------
		     +----------------note missing white space!!
                     V
class      fxBoolArrayPtr   {        
protected:                                  
        void destroy() { if (p) p->dec(); } 
        fxBoolArray   * p;                  
public:                                     
        fxBoolArrayPtr  () { p = 0; }



I tested my theory by manually removing all the spaces ( thanks VI!! )
in the pre-processro file, and it compiles ( almost )... but that's a 
different problem...


SOLUTION?????????????????????????????
-------------------------------------

WTF should Types.h be doing to try to concatenate these things together
WITH NO SPACES!!!!


Test Program
------------
#define CONCAT(a,b) 	a##b

#define THING(something)	\
	CONCAT(something,Ptr)

THING(something_long)
THING(short)

g++ -E t.c++ returns ( 2.95.2 )
-------------------------------

# 1 "/tmp/t.c++"
  something_longPtr   
  shortPtr   


g++ -V 2.7.2.2 -E t.c++
# 1 "/tmp/t.c++"
  something_longPtr   
  shortPtr   

xlC -E t.C

#line 6 "/tmp/t.C"
something_longPtr
shortPtr


So, Not really sure where to go from here...but...

Now that I have the problem narrowed down, I may try doing a repeat performance
with IBM's Compiler and see if the pre-processor output is any difference...

but that's for another day!!

Thanks for listening...
-- 
	Steve Williams, Calgary, Alberta, Canada
	Genie Computer Systems Inc.
	steve@genie96.com

"A man doesn't begin to attain wisdom until he recognizes that he is 
 no longer indispensable."
- Admiral Richard E. Byrd ( 1888-1957 )



Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services