Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!olivea!bu.edu!bu-pub.bu.edu From: eap@bu-pub.bu.edu (Eric A Pearce) Newsgroups: comp.lang.c++ Subject: Making all compilers happy with include files Message-ID: <73975@bu.edu.bu.edu> Date: 6 Feb 91 02:03:38 GMT Sender: news@bu.edu.bu.edu Organization: Boston University Info Tech Lines: 32 How have people been getting all these compilers to co-exist on the same system ? This would be on a Sun running SunOS 4.1. Sun 4.1 cc GNU gcc 1.38.90 GNU g++ 1.37.2 ATT C++ 2.1 This is what I've done in /usr/include/sys/stdtypes.h #ifdef __cplusplus typedef unsigned int size_t; #else #ifdef __GNUC__ typedef unsigned long size_t; #else typedef int size_t; /* ??? */ #endif #endif #if defined (__GNUG__) || (__GNUC__) typedef long int ptrdiff_t; #else typedef int ptrdiff_t; #endif Is there a cleaner way to do this? -e -- ------------------------------------------------------------------------------- Eric Pearce eap@bu-pub.bu.edu Boston University Information Technology 111 Cummington Street, Boston MA 02215 617-353-2780 voice 617-353-6260 fax