Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add extern "C" declarations (for C++) in installed headers #4963

Closed
vicuna opened this issue Jan 19, 2010 · 3 comments
Closed

Please add extern "C" declarations (for C++) in installed headers #4963

vicuna opened this issue Jan 19, 2010 · 3 comments
Assignees
Labels

Comments

@vicuna
Copy link

vicuna commented Jan 19, 2010

Original bug ID: 4963
Reporter: @glondu
Assigned to: @lefessan
Status: closed (set by @xavierleroy on 2013-08-31T10:44:17Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.1
Fixed in version: 3.13.0+dev
Category: ~DO NOT USE (was: OCaml general)
Has duplicate: #5467
Monitored by: mehdi @ygrek till smimram

Bug description

Hello,

In most system headers, declarations are surrounded by the following:

#ifdef __cplusplus
extern "C" {
#endif

[...]

#ifdef __cplusplus
}
#endif

allowing their direct use in C++ code. It would be nice if OCaml did the same.

Cheers,

Stéphane Glondu

Additional information

Bugreport forwarded from: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=565894

@vicuna
Copy link
Author

vicuna commented May 31, 2011

Comment author: @damiendoligez

Why not include them with this ?

extern "C" {
#include <caml/foo.h>
#include <caml/bar.h>
}

@vicuna
Copy link
Author

vicuna commented Aug 12, 2011

Comment author: @glondu

The point is to avoid that. Whether "that" is better or not is a matter of taste, I guess. Maybe you have some arguments against extern "C" in caml headers?

@vicuna
Copy link
Author

vicuna commented Jan 16, 2012

Comment author: @lefessan

Fixed in commit r12000 in the trunk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants