path: root/hurd
diff options
authorSamuel Thibault <>2016-11-12 00:59:02 +0100
committerSamuel Thibault <>2016-11-12 00:59:25 +0100
commitc5236a88a298f37e62974db4b3f449fc412c1990 (patch)
tree130cdac7326bc828a48a425d8d64736cbabb1083 /hurd
parent81e2377c246cf5576f01d5f459f287c72d29e4b5 (diff)
Comment on Darwin confusions
Diffstat (limited to 'hurd')
1 files changed, 13 insertions, 0 deletions
diff --git a/hurd/porting/guidelines.mdwn b/hurd/porting/guidelines.mdwn
index a76ffc8f..46a2bf22 100644
--- a/hurd/porting/guidelines.mdwn
+++ b/hurd/porting/guidelines.mdwn
@@ -181,6 +181,19 @@ Fixed code:
Replace with `getrlimit(RLIMIT_NOFILE,...)`
+## <a name="mach_darwin"> ifdef __MACH__ </a>
+Some applications put Apple Darwin-specific code inside `#ifdef __MACH__`
+guards. Such guard is clearly not enough, since not only Apple uses Mach as a
+kernel. This should be replaced by `#if defined(__MACH__) && defined(__APPLE__)`
+## <a name="mach_clock"> `mach/clock.h` </a>
+Some applications unconditionally use Darwin-specific functions coming
+from `mach/clock.h` to get the clock. This is unnecessarily unportable,
+`clock_gettime` can simply be used instead, and the ifdef __MACH__ guard for the `mach/clock.h`
+inclusion be fixed as explained above.
## <a name="GNU_specific_define_tt_"> </a> GNU specific `#define`
If you need to include specific code for GNU/Hurd using `#if` ... `#endif`, then you can use the `__GNU__` symbol to do so. But think (at least) thrice! before doing so. In most situations, this is completely unnecessary and will create more problems than it may solve. Better ask on the mailing list how to do it right if you can't think of a better solution.