diff options
Diffstat (limited to 'link/macmet')
-rw-r--r-- | link/macmet/Carbon-net.pfx | 5 | ||||
-rw-r--r-- | link/macmet/MoreCarbonAccessors.h | 43 | ||||
-rw-r--r-- | link/macmet/net.pfx | 2 |
3 files changed, 44 insertions, 6 deletions
diff --git a/link/macmet/Carbon-net.pfx b/link/macmet/Carbon-net.pfx index 926e2c20..f1b09699 100644 --- a/link/macmet/Carbon-net.pfx +++ b/link/macmet/Carbon-net.pfx @@ -1,3 +1,2 @@ -#define TARGET_API_MAC_CARBON 1 -#define _NETENT_ -#define NETWORK_SUPPORTED +#include "CarbonPrefix.h" +#include "net.pfx" diff --git a/link/macmet/MoreCarbonAccessors.h b/link/macmet/MoreCarbonAccessors.h index 71c2ecbe..4570d2e5 100644 --- a/link/macmet/MoreCarbonAccessors.h +++ b/link/macmet/MoreCarbonAccessors.h @@ -29,7 +29,7 @@ * * Version Creation Date: 2001-03-21 * -* $Revision: 1.3 $ +* $Revision: 1.4 $ * * File Description: * header for supporting Carbon calls in pre-Carbon targets @@ -77,4 +77,45 @@ # define DisableMenuItem(theMenu, item) DisableItem(theMenu, item) #endif // TARGET_API_MAC_CARBON +// CarbonForwardCompat.h + +// Problem: +// Carbon has certain platform requirements (e.g. PowerPC processor) that eliminate +// the possibility of certain conditions (e.g. code segments, 24-bit address mode) +// which required (or at least invited) special treatments (e.g. UnloadSeg(), StripAddress()), +// which, because the conditions requiring (or inviting) them can't occur in Carbon, +// are unsupported in Carbon. +// This makes some sense, but it makes trouble where it is desired to support Carbon *and* +// the legacy technologies. + +// Solution: +// Where possible, define macros such that calling code will work in all circumstances +// with little or no modification, without resorting to preprocessor directives in the code. + +// This file must be included AFTER ConditionalMacros.h. To make life simple, +// we include it. + +#if TARGET_API_MAC_CARBON +# define StripAddress(addr) (addr) +# define GetPortAndCall_(function, arg) \ + do { \ + GrafPtr port_; \ + GetPort(&port_); \ + function(GetWindowFromPort(port_), (arg)); \ + } while (0) +# ifdef __cplusplus +# include <QuickDraw.h> +# include "MacWindows.h" +inline void InvalRect(Rect *rect) { GetPortAndCall_(InvalWindowRect, rect); } +inline void InvalRgn(RgnHandle rgn) { GetPortAndCall_(InvalWindowRgn, rgn); } +inline void ValidRect(Rect *rect) { GetPortAndCall_(ValidWindowRect, rect); } +inline void ValidRgn(RgnHandle rgn) { GetPortAndCall_(ValidWindowRgn, rgn); } +# else // __cplusplus +# define InvalRect(rect) GetPortAndCall_(InvalWindowRect, (rect)) +# define InvalRgn(rgn) GetPortAndCall_(InvalWindowRgn, (rgn )) +# define ValidRect(rect) GetPortAndCall_(ValidWindowRect, (rect)) +# define ValidRgn(rgn) GetPortAndCall_(ValidWindowRgn, (rgn )) +# endif // __cplusplus +#endif // TARGET_API_MAC_CARBON + #endif diff --git a/link/macmet/net.pfx b/link/macmet/net.pfx index 5f6c5812..e69de29b 100644 --- a/link/macmet/net.pfx +++ b/link/macmet/net.pfx @@ -1,2 +0,0 @@ -#define _NETENT_ -#define NETWORK_SUPPORTED |