Skip to content

Name clash with memory.h header file with the Android NDK #5887

@vicuna

Description

@vicuna

Original bug ID: 5887
Reporter: vouillon
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2017-02-16T14:14:12Z)
Resolution: fixed
Priority: high
Severity: minor
Version: 4.00.1
Target version: 4.02.2+dev / +rc1
Fixed in version: 4.02.2+dev / +rc1
Category: runtime system and C interface
Tags: patch
Has duplicate: #4175
Related to: #6266
Monitored by: @whitequark @protz Camarade_Tux

Bug description

In the Android NDK, the stdlib.h header file includes memory.h.
When compiling the native runtime and the libraries in otherlibs, it's the OCaml memory.h file that gets included. The compilation then breaks when misc.h is included, as it includes stdlib.h before providing definitions need by memory.h.

A work-around is to temporarily define CAML_MEMORY_H before including stdlib.h
(see patch) in misc.h. As the memory.h system header file is empty, this is safe to do.

A better fix, which would also fix the name clash on io.h under Windows (#4175),
would be to move OCaml header files into a subdirectory "caml" of directory "byterun". I could implement that if there is some interest.

File attachments

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions