当我使用定义编译示例程序时GCRYPT_NO_DEPRECATED
,我收到以下 6 个警告:
/usr/local/Cellar/libgcrypt/1.5.0/include/gcrypt.h:1336: warning: ‘gcry_ac_io_mode_t’ is deprecated
/usr/local/Cellar/libgcrypt/1.5.0/include/gcrypt.h:1337: warning: ‘gcry_ac_io_type_t’ is deprecated
/usr/local/Cellar/libgcrypt/1.5.0/include/gcrypt.h:1344: warning: ‘gcry_ac_data_read_cb_t’ is deprecated
/usr/local/Cellar/libgcrypt/1.5.0/include/gcrypt.h:1358: warning: ‘gcry_ac_data_write_cb_t’ is deprecated
/usr/local/Cellar/libgcrypt/1.5.0/include/gcrypt.h:1393: warning: ‘gcry_md_algo_t’ is deprecated
/usr/local/Cellar/libgcrypt/1.5.0/include/gcrypt.h:1401: warning: ‘gcry_md_algo_t’ is deprecated
手动定义_GCRYPT_IN_LIBGCRYPT
可以解决 6 个警告,但该手册的劝告相当严格:
带有一个前置下划线的名称前缀是为内部使用而保留的,绝不应该被应用程序使用。
那么应该如何在没有警告的情况下编译 gcrypt 标头呢?