Bad Undefines in NSKeyedArchiver and NSKeyedArchiver?

2009-06-13 Thread Dave MacLachlan
Excuse me if this is a silly question, but I just ran into problems  
compiling these two headers (Foundation/NSKeyedArchiver.h and  
Foundation/NSArchiver.h) and the fix looks obvious, but it's also  
obvious that these files have been this way for years.


In both cases they have code that looks similar to this:

#ifndef _IN_NSKEYEDUNARCHIVER_M
#define GSIArrayvoid*
#endif
  GSIArray  _objMap; /* Decoded objects.*/
#ifndef _IN_NSKEYEDUNARCHIVER_M
#undef  GSUnarchiverArray
#endif

and

#ifndef _IN_NSUNARCHIVER_M
#define GSIArrayvoid*
#endif
  GSIArray  clsMap; /* Class crossreference map.*/
  GSIArray  objMap; /* Object crossreference map.   */
  GSIArray  ptrMap; /* Pointer crossreference map.  */
#ifndef _IN_NSUNARCHIVER_M
#undef  GSUnarchiverArray
#endif

It would seem to me that the #undef should be
#undef GSIArray in both cases, and not GSUnarchiverArray.

Am I missing something? Making this change cleaned up compilation for  
me. Otherwise I was getting errors about GSIArray being redefined.


Cheers,
Dave


___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev


Re: Bad Undefines in NSKeyedArchiver and NSKeyedArchiver?

2009-06-13 Thread Richard Frith-Macdonald


On 13 Jun 2009, at 07:26, Dave MacLachlan wrote:

Excuse me if this is a silly question, but I just ran into problems  
compiling these two headers (Foundation/NSKeyedArchiver.h and  
Foundation/NSArchiver.h) and the fix looks obvious, but it's also  
obvious that these files have been this way for years.


Thanks ... I fixed that ... though it's clearly harmless normally, as  
the macro is defined to the same thing twice and the compiler doesn't  
even warn when a macro is being defined to the same value twice.  If  
you are encountering compiler warnings/errors then I guess you must be  
redefining GSIArray yourself, which you probably shouldn't be doing.   
Maybe you want to look into using the new NSPointerArray class instead?
Obviously NSPointerArray is new, relatively untested code, but it's  
MacOS-X/Cocoa compatible.



___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev


Re: Bad Undefines in NSKeyedArchiver and NSKeyedArchiver?

2009-06-13 Thread Dave MacLachlan


On Jun 13, 2009, at 01:19 , Richard Frith-Macdonald wrote:



On 13 Jun 2009, at 07:26, Dave MacLachlan wrote:

Excuse me if this is a silly question, but I just ran into problems  
compiling these two headers (Foundation/NSKeyedArchiver.h and  
Foundation/NSArchiver.h) and the fix looks obvious, but it's also  
obvious that these files have been this way for years.


Thanks ... I fixed that ... though it's clearly harmless normally,  
as the macro is defined to the same thing twice and the compiler  
doesn't even warn when a macro is being defined to the same value  
twice.  If you are encountering compiler warnings/errors then I  
guess you must be redefining GSIArray yourself, which you probably  
shouldn't be doing.  Maybe you want to look into using the new  
NSPointerArray class instead?
Obviously NSPointerArray is new, relatively untested code, but it's  
MacOS-X/Cocoa compatible.


Great thanks.

Cheers,
Dave


___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev