Bug 55473 - quadmath.h should have extern "C" for C++ users
Summary: quadmath.h should have extern "C" for C++ users
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libquadmath (show other bugs)
Version: unknown
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-26 19:54 UTC by Janne Blomqvist
Modified: 2013-03-07 07:56 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Added cplusplus macro usage (520 bytes, patch)
2013-03-06 08:53 UTC, Shakthi Kannan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Janne Blomqvist 2012-11-26 19:54:12 UTC
quadmath.h is missing something like:


#ifdef __cplusplus
extern "C" {
#endif

/* Content of file */

#ifdef __cplusplus
} /* End extern "C".  */
#endif


As it is, C++ users who wish to use libquadmath have to do this manually before including quadmath.h. E.g.

http://gcc.gnu.org/ml/gcc-help/2011-06/msg00148.html

or for a more recent example

http://stackoverflow.com/questions/13571621/quadruple-precision-in-g-4-6-3-linux-using-quadmath
Comment 1 Shakthi Kannan 2013-03-06 08:53:19 UTC
Created attachment 29593 [details]
Added cplusplus macro usage
Comment 2 Tobias Burnus 2013-03-06 21:43:15 UTC
Janne and Shakth: The proposal is fine with me. However, it would help if you would simply submit a/the patch. For what it is worth, I think the patch is fine together with a ChangeLog.
Comment 3 Shakthi Kannan 2013-03-07 06:13:45 UTC
@Janne:

I had submitted the patch and ChangeLog at:

  http://gcc.gnu.org/ml/gcc-patches/2013-03/msg00223.html
Comment 4 Jakub Jelinek 2013-03-07 07:53:17 UTC
Author: jakub
Date: Thu Mar  7 07:53:10 2013
New Revision: 196517

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196517
Log:
	PR libquadmath/55473
	* quadmath.h: Add 'extern "C"' block for C++ use.

Modified:
    trunk/libquadmath/ChangeLog
    trunk/libquadmath/quadmath.h
Comment 5 Jakub Jelinek 2013-03-07 07:56:19 UTC
Fixed.