]> git.stg.codes - stg.git/blobdiff - libs/smux/include/stg/asn_codecs.h
Add missing CMakeLists.txt
[stg.git] / libs / smux / include / stg / asn_codecs.h
index 4a251d940880a03b24dc9f3fe41f2febb9b49211..4b2a294293c22d84ebafdd0d581739c6969fd447 100644 (file)
@@ -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 */