Closed sfd1v closed 9 months ago
You can set -std=c11
on GCC 4.8.5, but full support for C11—including _Generic
—only came in 4.9.0. Hence, you have two options:
Upgrade to GCC 4.9.0 or later.
Use the C99 prefixed function API instead of the C11 generic macro API. The C99 API has two major differences. Firstly, you must explicitly define hash and comparison functions for all types, including integer types and strings. The easiest solution is to just use the default functions provided by the library: vt_hash_integer
and vt_cmpr_integer
for all integer types and vt_hash_string
and vt_cmpr_string
for strings. Secondly, instead of prefixing API calls with vt_
, prefix them with the name of your hash-table type.
Here is an example.