X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/46b0747592074017ff0ea4b33d4a7194235886e5..08dd72f2d8d3d7766e4fa87f01840c3ed8211091:/libs/smux/include/stg/asn_codecs.h diff --git a/libs/smux/include/stg/asn_codecs.h b/libs/smux/include/stg/asn_codecs.h index 4a251d94..4b2a2942 100644 --- a/libs/smux/include/stg/asn_codecs.h +++ b/libs/smux/include/stg/asn_codecs.h @@ -3,8 +3,8 @@ * All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ -#ifndef _ASN_CODECS_H_ -#define _ASN_CODECS_H_ +#ifndef ASN_CODECS_H +#define ASN_CODECS_H #ifdef __cplusplus extern "C" { @@ -57,15 +57,15 @@ typedef struct asn_enc_rval_s { /* Pointer to the structure of that type */ void *structure_ptr; } asn_enc_rval_t; -#define _ASN_ENCODE_FAILED do { \ +#define ASN__ENCODE_FAILED do { \ asn_enc_rval_t tmp_error; \ tmp_error.encoded = -1; \ tmp_error.failed_type = td; \ tmp_error.structure_ptr = sptr; \ - ASN_DEBUG("Failed to encode element %s", td->name); \ + ASN_DEBUG("Failed to encode element %s", td ? td->name : ""); \ return tmp_error; \ } while(0) -#define _ASN_ENCODED_OK(rval) do { \ +#define ASN__ENCODED_OK(rval) do { \ rval.structure_ptr = 0; \ rval.failed_type = 0; \ return rval; \ @@ -88,14 +88,14 @@ typedef struct asn_dec_rval_s { enum asn_dec_rval_code_e code; /* Result code */ size_t consumed; /* Number of bytes consumed */ } asn_dec_rval_t; -#define _ASN_DECODE_FAILED do { \ +#define ASN__DECODE_FAILED do { \ asn_dec_rval_t tmp_error; \ tmp_error.code = RC_FAIL; \ tmp_error.consumed = 0; \ - ASN_DEBUG("Failed to decode element %s", td->name); \ + ASN_DEBUG("Failed to decode element %s", td ? td->name : ""); \ return tmp_error; \ } while(0) -#define _ASN_DECODE_STARVED do { \ +#define ASN__DECODE_STARVED do { \ asn_dec_rval_t tmp_error; \ tmp_error.code = RC_WMORE; \ tmp_error.consumed = 0; \ @@ -106,4 +106,4 @@ typedef struct asn_dec_rval_s { } #endif -#endif /* _ASN_CODECS_H_ */ +#endif /* ASN_CODECS_H */