Skip to content

Commit

Permalink
Port some minor nob.h changes from panim
Browse files Browse the repository at this point in the history
  • Loading branch information
rexim committed Jun 8, 2024
1 parent 963b490 commit 12048dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/nob.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

#define NOB_ARRAY_LEN(array) (sizeof(array)/sizeof(array[0]))
#define NOB_ARRAY_GET(array, index) \
(NOB_ASSERT(index >= 0), NOB_ASSERT(index < NOB_ARRAY_LEN(array)), array[index])
(NOB_ASSERT((size_t)index < NOB_ARRAY_LEN(array)), array[(size_t)index])

typedef enum {
NOB_INFO,
Expand Down Expand Up @@ -193,7 +193,9 @@ typedef struct {
void nob_cmd_render(Nob_Cmd cmd, Nob_String_Builder *render);

#define nob_cmd_append(cmd, ...) \
nob_da_append_many(cmd, ((const char*[]){__VA_ARGS__}), (sizeof((const char*[]){__VA_ARGS__})/sizeof(const char*)))
nob_da_append_many(cmd, \
((const char*[]){__VA_ARGS__}), \
(sizeof((const char*[]){__VA_ARGS__})/sizeof(const char*)))

// Free all the memory allocated by command arguments
#define nob_cmd_free(cmd) NOB_FREE(cmd.items)
Expand Down

0 comments on commit 12048dd

Please sign in to comment.