[patch] C++ mangeling of SPU headers

Jeff Johnston jjohnstn@redhat.com
Tue Jun 17 23:15:00 GMT 2008


Patch checked in.

-- Jeff J.

Ken Werner wrote:
> Hi,
>
> this patch prevents the symbols from being mangled if g++ is used. Ok to 
> apply?
>
> Ken
>
> newlib/ChangeLog:
>
> 2008-06-09  Ken Werner  <ken.werner@de.ibm.com>
>
> 	* libc/machine/spu/sys/dirent.h: Add extern "C" specifier if C++.
> 	* libc/machine/spu/sys/sched.h: Likewise.
> 	* libc/machine/spu/sys/syscall.h: Likewise.
>
> Index: src/newlib/libc/machine/spu/sys/dirent.h
> ===================================================================
> --- src.orig/newlib/libc/machine/spu/sys/dirent.h
> +++ src/newlib/libc/machine/spu/sys/dirent.h
> @@ -32,6 +32,9 @@
>  */
>  #ifndef _SYS_DIRENT_H
>  #define _SYS_DIRENT_H
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
>  
>  #define MAXNAMLEN	255
>  
> @@ -54,4 +57,7 @@ struct dirent *readdir (DIR *);
>  void rewinddir(DIR *);
>  void seekdir(DIR *dir, off_t offset);
>  off_t telldir(DIR *dir);
> +#ifdef __cplusplus
> +}
> +#endif
>  #endif
> Index: src/newlib/libc/machine/spu/sys/sched.h
> ===================================================================
> --- src.orig/newlib/libc/machine/spu/sys/sched.h
> +++ src/newlib/libc/machine/spu/sys/sched.h
> @@ -1,6 +1,12 @@
>  #ifndef _SYS_SCHED_H
>  #define _SYS_SCHED_H
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
>  
>  int sched_yield(void);
>  
> +#ifdef __cplusplus
> +}
> +#endif
>  #endif
> Index: src/newlib/libc/machine/spu/sys/syscall.h
> ===================================================================
> --- src.orig/newlib/libc/machine/spu/sys/syscall.h
> +++ src/newlib/libc/machine/spu/sys/syscall.h
> @@ -1,4 +1,10 @@
>  #ifndef _SYS_SYSCALL_H
>  #define _SYS_SYSCALL_H
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
>  int __send_to_ppe(unsigned int signalcode, unsigned int opcode, void *data);
> +#ifdef __cplusplus
> +}
> +#endif
>  #endif
>   



More information about the Newlib mailing list