Branch: Tag:

2005-03-14

2005-03-14 17:38:41 by Per Hedbor <ph@opera.com>

And this might even work for code that uses the return value of ADD_STORAGE. A better workaround is needed for c++-mode.

Rev: src/program.h:1.216

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: program.h,v 1.215 2005/03/14 17:20:23 per Exp $ + || $Id: program.h,v 1.216 2005/03/14 17:38:41 per Exp $   */      #ifndef PROGRAM_H
614:      #define COMPILER_IN_CATCH 1    + #ifdef __cplusplus   #define ADD_STORAGE(X) do{ \    struct { char _x; X _z; } *___offset=NULL; \    low_add_storage(sizeof(X), PTR_TO_INT(&___offset->_z),0); \    } while(0) -  + #else + #define ADD_STORAGE(X) low_add_storage(sizeof(X), ALIGNOF(X),0) + #endif   #define STORAGE_NEEDED(X) ((X)->storage_needed - (X)->inherits[0].storage_offset)      #define FOO(NUMTYPE,TYPE,ARGTYPE,NAME) void PIKE_CONCAT(add_to_,NAME(ARGTYPE ARG));