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

Move all installable headers in caml/ sub-directories #12764

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

MisterDA
Copy link
Contributor

C11 defines the <threads.h> header. Within the current tests, the systhreads/threads.h header happens to be in the include path, and thus has higher priority than the standard header, which cannot be used. Namespacing fixes this problem.

In addition, there were discrepancies between on the one hand C files (.c, .h) in internal code and tests, expecting

#include "unixsupport.h"

and on the other hand external code, (also documented in the manual), expecting

#include <caml/unixsupport.h>

Moving the location of the headers allows to properly namespace them:

#include "caml/unixsupport.h"

This also helps highlighting within the code of a library which header is installed.

There are no cases where it would make sense to replace double quotes includes with angle brackets.

Traditionally this sub-directory where installable headers can be found is named include/.

@gasche
Copy link
Member

gasche commented Dec 13, 2023

"No problem."

Copy link
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just needs a rebase to get rid of the conflict on Changes

C11 defines the `<threads.h>` header. Within the current tests, the
`systhreads/threads.h` header happens to be in the include path, and
thus has higher priority than the standard header, which cannot be
used. Namespacing fixes this problem.

In addition, there were discrepancies between on the one hand C
files (`.c`, `.h`) in internal code and tests, expecting

    #include "unixsupport.h"

and on the other hand external code, (also documented in the manual),
expecting

    #include <caml/unixsupport.h>

Moving the location of the headers allows to properly namespace them:

    #include "caml/unixsupport.h"

This also helps highlighting within the code of a library which header
is installed.
@dra27 dra27 merged commit 3aeee83 into ocaml:trunk Dec 18, 2023
9 checks passed
@MisterDA MisterDA deleted the headers-caml-subdir branch December 18, 2023 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants