Rainer Orth <r...@cebitec.uni-bielefeld.de> writes: > diff --git a/gcc/system.h b/gcc/system.h > --- a/gcc/system.h > +++ b/gcc/system.h > @@ -24,6 +24,10 @@ along with GCC; see the file COPYING3. > #ifndef GCC_SYSTEM_H > #define GCC_SYSTEM_H > > +#ifdef __cplusplus > +extern "C" { > +#endif > + > /* We must include stdarg.h before stdio.h. */ > #include <stdarg.h> > > @@ -969,4 +973,8 @@ helper_const_non_const_cast (const char > #define DEBUG_VARIABLE > #endif > > +#ifdef __cplusplus > +} > +#endif > + > #endif /* ! GCC_SYSTEM_H */
I agree with Joseph that this is wrong. We must never wrap the #include of a system header file with extern "C". That will simply break on some systems. You should only wrap extern "C" around the various HAVE_DECL declarations. > diff --git a/include/xregex2.h b/include/xregex2.h > --- a/include/xregex2.h > +++ b/include/xregex2.h > @@ -399,7 +399,11 @@ struct re_pattern_buffer > typedef struct re_pattern_buffer regex_t; > > /* Type for byte offsets within the string. POSIX mandates this. */ > +#if defined(__osf__) && defined(__cplusplus) > +typedef off_t regoff_t; > +#else > typedef int regoff_t; > +#endif No, the right way to handle this is to add regoff_t to include/xregex.h. Ian