attractivechaos / klib

A standalone and lightweight C library
http://attractivechaos.github.io/klib/
MIT License
4.18k stars 556 forks source link

kvec: remove need to pass type? #117

Closed damag closed 5 years ago

damag commented 5 years ago

Many of kvec.h function macros require passing the type being stored (kv_resize, kv_copy, kv_push, kv_pushp, kv_a) but this seems to not actually be needed. It's only used for two reasons:

Has this not been changed simply to not break the current API?

attractivechaos commented 5 years ago

Then kvec won't work with C++. All klib components are supposed to be compiled with a C++ compiler. We may use __typeof__, but that is a compiler extension.

bfredl commented 5 years ago

@damag FWIW neovim's fork of this library https://github.com/neovim/neovim/blob/master/src/nvim/lib/kvec.h has some of these changes.

damag commented 5 years ago

Ah nice, thanks for the info.

On Fri, Dec 28, 2018 at 7:56 PM Björn Linse notifications@github.com wrote:

@damag https://github.com/damag FWIW neovim's fork of this library https://github.com/neovim/neovim/blob/master/src/nvim/lib/kvec.h has some of these changes.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/attractivechaos/klib/issues/117#issuecomment-450409656, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKIDs9rDXzBHhEX8P5wRA9JrxHI9ZsWks5u9mlwgaJpZM4Zjnpd .