Module: kamailio
Branch: master
Commit: 49a315048c062f4158407d02a3a61dbf6306069d
URL:
https://github.com/kamailio/kamailio/commit/49a315048c062f4158407d02a3a61db…
Author: Spencer Thomason <spencer(a)whiteskycommunications.com>
Committer: Spencer Thomason <spencer(a)whiteskycommunications.com>
Date: 2016-07-01T07:33:42-07:00
pdb: set packed attribute on enum conditionally
- Solaris Studio does not support packed attribute on enums
---
Modified: modules/pdb/common.h
---
Diff:
https://github.com/kamailio/kamailio/commit/49a315048c062f4158407d02a3a61db…
Patch:
https://github.com/kamailio/kamailio/commit/49a315048c062f4158407d02a3a61db…
---
diff --git a/modules/pdb/common.h b/modules/pdb/common.h
index 3c7b993..1ba16cd 100644
--- a/modules/pdb/common.h
+++ b/modules/pdb/common.h
@@ -43,20 +43,26 @@
#define PDB_VERSION 1
+#ifdef __SUNPRO_C
+#define ENUM_ATTR_PACKED enum
+#else
+#define ENUM_ATTR_PACKED enum __attribute__((packed))
+#endif
+
typedef int16_t carrier_t;
-enum __attribute__((packed)) pdb_versions {
+ENUM_ATTR_PACKED pdb_versions {
PDB_VERSION_1 = 1,
PDB_VERSION_MAX
};
-enum __attribute__((packed)) pdb_types {
+ENUM_ATTR_PACKED pdb_types {
PDB_TYPE_REQUEST_ID = 0, /* request pdb type */
PDB_TYPE_REPLY_ID, /* reply pdb type */
PDB_TYPE_MAX
};
-enum __attribute__((packed)) pdb_codes {
+ENUM_ATTR_PACKED pdb_codes {
PDB_CODE_DEFAULT = 0, /* for request */
PDB_CODE_OK, /* for response - OK */
PDB_CODE_NOT_NUMBER, /* for response - letters found in the number */