From: Greg Hudson Date: Sun, 13 May 2012 17:15:34 +0000 (-0400) Subject: Avoid extern inline in asn1buf.h X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=eeba86d45ef4e13086b3f88cde863ddf8649f07b;p=krb5.git Avoid extern inline in asn1buf.h Avoid using extern inline in asn1buf.h, as there are two conflicting sets of semantics (gnu89's and C99's). gcc defaults to the gnu89 semantics, which we were using, while clang defines __GNUC__ but defaults to the C99 semantics. To simplify things, use static inline instead, like we do in k5-int.h. --- diff --git a/src/lib/krb5/asn.1/asn1buf.h b/src/lib/krb5/asn.1/asn1buf.h index 44a4b7eeb..0d7138d20 100644 --- a/src/lib/krb5/asn.1/asn1buf.h +++ b/src/lib/krb5/asn.1/asn1buf.h @@ -102,14 +102,14 @@ asn1_error_code asn1buf_create(asn1buf **buf); void asn1buf_destroy(asn1buf **buf); /* effects Deallocates **buf, sets *buf to NULL. */ -asn1_error_code asn1buf_insert_octet(asn1buf *buf, const int o); /* * requires *buf is allocated * effects Inserts o into the buffer *buf, expanding the buffer if * necessary. Returns ENOMEM memory is exhausted. */ #if ((__GNUC__ >= 2) && !defined(ASN1BUF_OMIT_INLINE_FUNCS)) && !defined(CONFIG_SMALL) -extern __inline__ asn1_error_code asn1buf_insert_octet(asn1buf *buf, const int o) +static inline asn1_error_code +asn1buf_insert_octet(asn1buf *buf, const int o) { asn1_error_code retval; @@ -119,6 +119,8 @@ extern __inline__ asn1_error_code asn1buf_insert_octet(asn1buf *buf, const int o (buf->next)++; return 0; } +#else +asn1_error_code asn1buf_insert_octet(asn1buf *buf, const int o); #endif asn1_error_code