The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #14370 from MisterDA/cxx-headers-compat

Fix headers for C⁠+⁠+ inclusion, again, again

authored by

Gabriel Scherer and committed by
GitHub
0ba65b60 5f9cb866

+14 -15
+3
Changes
··· 435 435 - #14332: Fix missing TSan instrumentation in subexpressions 436 436 (Vincent Laviron, review by Gabriel Scherer and Olivier Nicole) 437 437 438 + - #14370: Fix headers for C++ inclusion. 439 + (Antonin Décimo, review by Gabriel Scherer) 440 + 438 441 OCaml 5.4.0 (9 October 2025) 439 442 ---------------------------- 440 443
+1 -1
otherlibs/unix/caml/unixsupport.h
··· 46 46 SOCKET socket; 47 47 } fd; /* Real windows handle */ 48 48 enum { KIND_HANDLE, KIND_SOCKET } kind; 49 - _Atomic int crt_fd; /* C runtime descriptor */ 49 + atomic_int crt_fd; /* C runtime descriptor */ 50 50 unsigned int flags_fd; /* See FLAGS_FD_* */ 51 51 }; 52 52
+4 -4
runtime/addrmap.c
··· 57 57 for (uintnat pos = pos_initial(t, key); ; pos = pos_next(t, pos)) { 58 58 CAMLassert(t->entries[pos].key != ADDRMAP_INVALID_KEY); 59 59 if (t->entries[pos].key == key) 60 - return t->entries[pos].value; 60 + return t->entries[pos].val; 61 61 } 62 62 } 63 63 ··· 68 68 t->size = sz; 69 69 for (uintnat i = 0; i < sz; i++) { 70 70 t->entries[i].key = ADDRMAP_INVALID_KEY; 71 - t->entries[i].value = ADDRMAP_NOT_PRESENT; 71 + t->entries[i].val = ADDRMAP_NOT_PRESENT; 72 72 } 73 73 } 74 74 ··· 98 98 t->entries[pos].key = key; 99 99 } 100 100 if (t->entries[pos].key == key) { 101 - return &t->entries[pos].value; 101 + return &t->entries[pos].val; 102 102 } 103 103 } 104 104 /* failed to insert, rehash and try again */ ··· 110 110 if (old_table[i].key != ADDRMAP_INVALID_KEY) { 111 111 value* p = caml_addrmap_insert_pos(t, old_table[i].key); 112 112 CAMLassert(*p == ADDRMAP_NOT_PRESENT); 113 - *p = old_table[i].value; 113 + *p = old_table[i].val; 114 114 } 115 115 } 116 116 caml_stat_free(old_table);
+6 -10
runtime/caml/addrmap.h
··· 15 15 #ifndef CAML_ADDRMAP_H 16 16 #define CAML_ADDRMAP_H 17 17 18 - #include "mlvalues.h" 18 + #ifdef CAML_INTERNALS 19 19 20 - #ifdef __cplusplus 21 - extern "C" { 22 - #endif 20 + #include "mlvalues.h" 23 21 24 22 /* An addrmap is a value -> value hashmap, where 25 23 the values are blocks */ 26 24 27 - struct addrmap_entry { value key, value; }; 25 + struct addrmap_entry { value key; value val; }; 28 26 struct addrmap { 29 27 struct addrmap_entry* entries; 30 28 uintnat size; ··· 84 82 addrmap_iterator i) 85 83 { 86 84 CAMLassert(caml_addrmap_iter_ok(t, i)); 87 - return t->entries[i].value; 85 + return t->entries[i].val; 88 86 } 89 87 90 88 Caml_inline value* caml_addrmap_iter_val_pos(struct addrmap* t, 91 89 addrmap_iterator i) 92 90 { 93 91 CAMLassert(caml_addrmap_iter_ok(t, i)); 94 - return &t->entries[i].value; 92 + return &t->entries[i].val; 95 93 } 96 94 97 95 Caml_inline addrmap_iterator caml_addrmap_iterator(struct addrmap* t) ··· 99 97 return caml_addrmap_next(t, (uintnat)(-1)); 100 98 } 101 99 102 - #ifdef __cplusplus 103 - } 104 - #endif 100 + #endif /* CAML_INTERNALS */ 105 101 106 102 #endif /* CAML_ADDRMAP_H */