lib/hx509: declare and apply HX509_LIB_xxx macros

libhx509 is not built according to the same export and calling conventions
on Windows as the other libraries.  This change declares and applies
HX509_LIB_FUNCTION, HX509_LIB_NORETURN_FUNCTION, HX509_LIB_CALL and
HX509_LIB_VARIABLE to lib/hx509.

As a result of this change the calling convention for exported functions
will be __stdcall instead of __cdecl.

Change-Id: Ibc3f05e8088030ef7d13798f1d9c9b190bc57797
This commit is contained in:
Jeffrey Altman
2019-01-02 01:50:52 -05:00
committed by Nico Williams
parent bec4818943
commit 1dd38cc3de
26 changed files with 321 additions and 299 deletions

View File

@@ -91,7 +91,7 @@ struct hx509_revoke_ctx_data {
* @ingroup hx509_revoke
*/
int
HX509_LIB_FUNCTION int HX509_LIB_CALL
hx509_revoke_init(hx509_context context, hx509_revoke_ctx *ctx)
{
*ctx = calloc(1, sizeof(**ctx));
@@ -107,7 +107,7 @@ hx509_revoke_init(hx509_context context, hx509_revoke_ctx *ctx)
return 0;
}
hx509_revoke_ctx
HX509_LIB_FUNCTION hx509_revoke_ctx HX509_LIB_CALL
_hx509_revoke_ref(hx509_revoke_ctx ctx)
{
if (ctx == NULL)
@@ -137,7 +137,7 @@ free_ocsp(struct revoke_ocsp *ocsp)
* @ingroup hx509_revoke
*/
void
HX509_LIB_FUNCTION void HX509_LIB_CALL
hx509_revoke_free(hx509_revoke_ctx *ctx)
{
size_t i ;
@@ -399,7 +399,7 @@ load_ocsp(hx509_context context, struct revoke_ocsp *ocsp)
* @ingroup hx509_revoke
*/
int
HX509_LIB_FUNCTION int HX509_LIB_CALL
hx509_revoke_add_ocsp(hx509_context context,
hx509_revoke_ctx ctx,
const char *path)
@@ -636,7 +636,7 @@ load_crl(hx509_context context, const char *path, time_t *t, CRLCertificateList
* @ingroup hx509_revoke
*/
int
HX509_LIB_FUNCTION int HX509_LIB_CALL
hx509_revoke_add_crl(hx509_context context,
hx509_revoke_ctx ctx,
const char *path)
@@ -706,7 +706,7 @@ hx509_revoke_add_crl(hx509_context context,
* @ingroup hx509_revoke
*/
int
HX509_LIB_FUNCTION int HX509_LIB_CALL
hx509_revoke_verify(hx509_context context,
hx509_revoke_ctx ctx,
hx509_certs certs,
@@ -994,7 +994,7 @@ out:
* @ingroup hx509_revoke
*/
int
HX509_LIB_FUNCTION int HX509_LIB_CALL
hx509_ocsp_request(hx509_context context,
hx509_certs reqcerts,
hx509_certs pool,
@@ -1194,7 +1194,7 @@ print_crl(hx509_context context, struct revoke_crl *crl, FILE *out)
*
*/
int
HX509_LIB_FUNCTION int HX509_LIB_CALL
hx509_revoke_print(hx509_context context,
hx509_revoke_ctx ctx,
FILE *out)
@@ -1241,7 +1241,7 @@ hx509_revoke_print(hx509_context context,
* @ingroup hx509_revoke
*/
int
HX509_LIB_FUNCTION int HX509_LIB_CALL
hx509_revoke_ocsp_print(hx509_context context, const char *path, FILE *out)
{
struct revoke_ocsp ocsp;
@@ -1287,7 +1287,7 @@ hx509_revoke_ocsp_print(hx509_context context, const char *path, FILE *out)
* @ingroup hx509_verify
*/
int
HX509_LIB_FUNCTION int HX509_LIB_CALL
hx509_ocsp_verify(hx509_context context,
time_t now,
hx509_cert cert,
@@ -1396,7 +1396,7 @@ struct hx509_crl {
* @ingroup hx509_verify
*/
int
HX509_LIB_FUNCTION int HX509_LIB_CALL
hx509_crl_alloc(hx509_context context, hx509_crl *crl)
{
int ret;
@@ -1429,7 +1429,7 @@ hx509_crl_alloc(hx509_context context, hx509_crl *crl)
* @ingroup hx509_verify
*/
int
HX509_LIB_FUNCTION int HX509_LIB_CALL
hx509_crl_add_revoked_certs(hx509_context context,
hx509_crl crl,
hx509_certs certs)
@@ -1450,7 +1450,7 @@ hx509_crl_add_revoked_certs(hx509_context context,
* @ingroup hx509_verify
*/
int
HX509_LIB_FUNCTION int HX509_LIB_CALL
hx509_crl_lifetime(hx509_context context, hx509_crl crl, int delta)
{
crl->expire = time(NULL) + delta;
@@ -1466,7 +1466,7 @@ hx509_crl_lifetime(hx509_context context, hx509_crl crl, int delta)
* @ingroup hx509_verify
*/
void
HX509_LIB_FUNCTION void HX509_LIB_CALL
hx509_crl_free(hx509_context context, hx509_crl *crl)
{
if (*crl == NULL)
@@ -1525,7 +1525,7 @@ add_revoked(hx509_context context, void *ctx, hx509_cert cert)
* @ingroup hx509_verify
*/
int
HX509_LIB_FUNCTION int HX509_LIB_CALL
hx509_crl_sign(hx509_context context,
hx509_cert signer,
hx509_crl crl,