From be594f1e0b1d3a15591dfdf2182bfdb02fef3408 Mon Sep 17 00:00:00 2001 From: Sean Barrett Date: Sun, 11 Aug 2019 14:37:45 -0700 Subject: [PATCH] stb_ds: maybe avoid problem with inferring template type from enum with gcc --- README.md | 4 ++-- stb_ds.h | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index bfbe9c8..64ffa4a 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ library | lastest version | category | LoC | description **[stb_image_write.h](stb_image_write.h)** | 1.13 | graphics | 1619 | image writing to disk: PNG, TGA, BMP **[stb_image_resize.h](stb_image_resize.h)** | 0.96 | graphics | 2630 | resize images larger/smaller with good quality **[stb_rect_pack.h](stb_rect_pack.h)** | 1.00 | graphics | 628 | simple 2D rectangle packer with decent quality -**[stb_ds.h](stb_ds.h)** | 0.6 | utility | 1699 | typesafe dynamic array and hash tables for C, will compile in C++ +**[stb_ds.h](stb_ds.h)** | 0.61 | utility | 1696 | typesafe dynamic array and hash tables for C, will compile in C++ **[stb_sprintf.h](stb_sprintf.h)** | 1.06 | utility | 1860 | fast sprintf, snprintf for C/C++ **[stretchy_buffer.h](stretchy_buffer.h)** | 1.03 | utility | 262 | typesafe dynamic array for C (i.e. approximation to vector<>), doesn't compile as C++ **[stb_textedit.h](stb_textedit.h)** | 1.13 | user interface | 1404 | guts of a text editor for games etc implementing them from scratch @@ -43,7 +43,7 @@ library | lastest version | category | LoC | description **[stb_include.h](stb_include.h)** | 0.01 | misc | 288 | implement recursive #include support, particularly for GLSL Total libraries: 22 -Total lines of C code: 56064 +Total lines of C code: 56061 FAQ diff --git a/stb_ds.h b/stb_ds.h index 951a02b..c6a7818 100644 --- a/stb_ds.h +++ b/stb_ds.h @@ -1,4 +1,4 @@ -/* stb_ds.h - v0.6 - public domain data structures - Sean Barrett 2019 +/* stb_ds.h - v0.61 - public domain data structures - Sean Barrett 2019 This is a single-header-file library that provides easy-to-use dynamic arrays and hash tables for C (also works in C++). @@ -573,11 +573,8 @@ struct stbds_string_arena unsigned char mode; // this isn't used by the string arena itself }; -enum -{ - STBDS_HM_BINARY, - STBDS_HM_STRING, -}; +#define STBDS_HM_BINARY 0 +#define STBDS_HM_STRING 1 enum {