From 49a315048c062f4158407d02a3a61dbf6306069d Mon Sep 17 00:00:00 2001 From: Spencer Thomason Date: Thu, 30 Jun 2016 13:24:00 -0700 Subject: [PATCH] pdb: set packed attribute on enum conditionally - Solaris Studio does not support packed attribute on enums --- modules/pdb/common.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/pdb/common.h b/modules/pdb/common.h index 3c7b9939941..1ba16cdf98f 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 */