diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-09-17 16:15:59 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-09-17 16:15:59 +0000 |
commit | a8e12bf08aa151c2b82ebc2c46f35caadd2ae67f (patch) | |
tree | 988b4d1ccd69eb9e885fb5fb8b09c52b1da3a939 /docs | |
parent | 176b3dc7dcb301032363561247eb081bfc80a680 (diff) | |
download | ATCD-a8e12bf08aa151c2b82ebc2c46f35caadd2ae67f.tar.gz |
added guideline to define ACE_ typedefs to reduce the number of #ifdefs
Diffstat (limited to 'docs')
-rw-r--r-- | docs/ACE-guidelines.html | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/ACE-guidelines.html b/docs/ACE-guidelines.html index 50187c5b12b..52c5e0cc96f 100644 --- a/docs/ACE-guidelines.html +++ b/docs/ACE-guidelines.html @@ -126,6 +126,29 @@ bgcolor="#ffffff"> or <code>TAO_</code>. There are too many system headers out there that #define <code>OK</code>, <code>SUCCESS</code>, <code>ERROR</code>, and so on.<p> + + <li>Try to centralize <code>#ifdefs</code> with <code>typedefs</code> + and <code>#defines</code>. For example, use this: + <pre> + #if defined(ACE_PSOS) + typedef long ACE_NETIF_TYPE; + # define ACE_DEFAULT_NETIF 0 + #else /* ! ACE_PSOS */ + typedef const ASYS_TCHAR* ACE_NETIF_TYPE; + # define ACE_DEFAULT_NETIF ASYS_TEXT("le0") + #endif /* ! ACE_PSOS */ + </pre><p> + + instead of: + + <pre><p> + #if defined (ACE_PSOS) + // pSOS supports numbers, not names for network interfaces + long net_if, + #else /* ! ACE_PSOS */ + const ASYS_TCHAR *net_if, + #endif /* ! ACE_PSOS */ + </pre><p> </ul> <li><strong>C++ Syntax and Constructs</strong><p> |