This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH v2] sh: Add "extern "C"" to __set_fpscr function
- From: Nobuhiro Iwamatsu <iwamatsu at nigauri dot org>
- To: libc-alpha at sourceware dot org
- Date: Tue, 28 Sep 2010 14:39:58 +0900
- Subject: [PATCH v2] sh: Add "extern "C"" to __set_fpscr function
When user compiles program that used _FPU_SETCW in sh4 in C++,
become the error.
Because 'extern "C"' is not set to __set_fpscr.
2010-09-28 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* sysdeps/sh/sh4/fpu/fpu_control.h:
Add 'extern "C"' protection to __set_fpscr.
---
sysdeps/sh/sh4/fpu/fpu_control.h | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/sysdeps/sh/sh4/fpu/fpu_control.h b/sysdeps/sh/sh4/fpu/fpu_control.h
index d1be46d..249dfa4 100644
--- a/sysdeps/sh/sh4/fpu/fpu_control.h
+++ b/sysdeps/sh/sh4/fpu/fpu_control.h
@@ -1,5 +1,5 @@
/* FPU control word definitions. SH version.
- Copyright (C) 1999, 2000, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -46,7 +46,11 @@ typedef unsigned int fpu_control_t;
#if defined __GNUC__
/* GCC provides this function. */
+/* Allow the use in C++ code. */
+#include <features.h>
+__BEGIN_DECLS
extern void __set_fpscr (unsigned long);
+__END_DECLS
#define _FPU_SETCW(cw) __set_fpscr ((cw))
#else
#define _FPU_SETCW(cw) __asm__ ("lds %0,fpscr" : : "r" (cw))
--
1.7.1