Skip to content

Commit

Permalink
pdb: set packed attribute on enum conditionally
Browse files Browse the repository at this point in the history
- Solaris Studio does not support packed attribute on enums
  • Loading branch information
sjthomason committed Jul 1, 2016
1 parent 16e6bdf commit 49a3150
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions modules/pdb/common.h
Expand Up @@ -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 */
Expand Down

0 comments on commit 49a3150

Please sign in to comment.