diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ee8f6c8..0be31397 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. ## Unreleased - ??? +- Add `declare-headers` to jpm. +- Fix error using unix pipes on BSDs. - Support .cc and .cxx extensions in `jpm` for C++ code. - Change networking code to not create as many HUP errors. - Add `net/shutdown` to close sockets in one direction without hang ups. diff --git a/jpm b/jpm index 3d1a505d..8bc62a65 100755 --- a/jpm +++ b/jpm @@ -452,6 +452,7 @@ [opts] @[;(opt opts :cflags default-cflags) (string "-I" (dyn :headerpath JANET_HEADERPATH)) + (string "-I" (dyn :modpath JANET_MODPATH)) (string "-O" (opt opts :optimize 2))]) (defn- getcppflags @@ -459,6 +460,7 @@ [opts] @[;(opt opts :cppflags default-cppflags) (string "-I" (dyn :headerpath JANET_HEADERPATH)) + (string "-I" (dyn :modpath JANET_MODPATH)) (string "-O" (opt opts :optimize 2))]) (defn- entry-name @@ -1053,6 +1055,16 @@ int main(int argc, const char **argv) { (each s sources (install-rule s path)))) +(defn declare-headers + "Declare headers for a library installation. Installed headers can be used by other native + libraries." + [&keys {:headers headers :prefix prefix}] + (def path (string (dyn :modpath JANET_MODPATH) (or prefix ""))) + (if (bytes? headers) + (install-rule headers path) + (each h headers + (install-rule h path)))) + (defn declare-bin "Declare a generic file to be installed as an executable." [&keys {:main main}] diff --git a/src/core/pp.c b/src/core/pp.c index 252543e7..3846a660 100644 --- a/src/core/pp.c +++ b/src/core/pp.c @@ -617,7 +617,7 @@ static void janet_pretty_one(struct pretty *S, Janet x, int is_dict_value) { if (mincap >= INT32_MAX / 2) { S->keysort_capacity = INT32_MAX; } else { - S->keysort_capacity = (int32_t) (mincap * 2); + S->keysort_capacity = (int32_t)(mincap * 2); } S->keysort_buffer = janet_srealloc(S->keysort_buffer, sizeof(int32_t) * S->keysort_capacity); if (NULL == S->keysort_buffer) {