summaryrefslogtreecommitdiff
path: root/link/macmet
diff options
context:
space:
mode:
authorAaron M. Ucko <ucko@debian.org>2005-03-23 19:38:09 +0000
committerAaron M. Ucko <ucko@debian.org>2005-03-23 19:38:09 +0000
commit9334e3885ef056415008956cb520e26ac220a1cb (patch)
treeb07bc2353ba2abf3c09b7d4bbcd710928db2c5c8 /link/macmet
parent3fc377c9a9cd6419f4ab6c21b956d5a98ce62f0b (diff)
Load ncbi (20011220) into ncbi-tools6/branches/upstream/current.
Diffstat (limited to 'link/macmet')
-rw-r--r--link/macmet/Carbon-net.pfx5
-rw-r--r--link/macmet/MoreCarbonAccessors.h43
-rw-r--r--link/macmet/net.pfx2
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