Heavy use of macros to do metaprogramming is a strong sign it's time to move to a more powerful language.
Generic dynamic array in 60 lines of C
11–20 of 110 posts
Re: Generic dynamic array in 60 lines of C
#12Re: Generic dynamic array in 60 lines of C
#13There's also a well-known one here, in klib: https://github.com/attractivechaos/klib/blob/master/kvec.h
Re: Generic dynamic array in 60 lines of C
#14Heavy use of macros to do metaprogramming is a strong sign it's time to move to a more powerful language.
Re: Generic dynamic array in 60 lines of C
#15Heavy use of macros to do metaprogramming is a strong sign it's time to move to a more powerful language.
I don't have this luxury if I want to learn about ffmpeg libraries, its all written in c, almost all media and hardware accelerator libraries are written in c, you go to another language they just bind to c. its soo frustrating but I've no choice but to stick with c.
(I know these are far an in-between for ffmpeg, too many leaky abstractions.)
Re: Generic dynamic array in 60 lines of C
#16Heavy use of macros to do metaprogramming is a strong sign it's time to move to a more powerful language.
I don't have this luxury if I want to learn about ffmpeg libraries, its all written in c, almost all media and hardware accelerator libraries are written in c, you go to another language they just bind to c. its soo frustrating but I've no choice but to stick with c.
For example, a C++ Vector provides a generic container and the code can still call C functions with the underlying array.
This is in the "Doctor it hurts if I do X" bucket.
https://stackoverflow.com/questions/2923272/how-to-convert-v...
Re: Generic dynamic array in 60 lines of C
#17Re: Generic dynamic array in 60 lines of C
#18Heavy use of macros to do metaprogramming is a strong sign it's time to move to a more powerful language.
Re: Generic dynamic array in 60 lines of C
#19Earlier quoted context omitted.
I don't have this luxury if I want to learn about ffmpeg libraries, its all written in c, almost all media and hardware accelerator libraries are written in c, you go to another language they just bind to c. its soo frustrating but I've no choice but to stick with c.
Most languages have the ability to call C functions. Use the language that helps you write your code and convert to call the third party API. For example, a C++ Vector provides a generic container and the code can still call C functions with the underlying array. This is in the "Doctor it hurts if I do X" bucket. https://stackoverflow.com/questions/2923272/how-to-convert-v...
Re: Generic dynamic array in 60 lines of C
#20Why use macros instead of inline functions?