# HG changeset patch
# User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
# Date 2011-03-23 22:05:32
# Node ID 26f8844d17576c7fd6b0f63de1fb13a3cacb177f
# Parent  cede00420e1e3456d1413ca64ab33ff74a4a8b3a

osutil: replace #import with #include, and add a check for it

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -180,6 +180,7 @@ cpats = [
     (r'^[^#]\w[+/*]\w', "missing whitespace in expression"),
     (r'^#\s+\w', "use #foo, not # foo"),
     (r'[^\n]\Z', "no trailing newline"),
+    (r'^\s*#import\b', "use only #include in standard C code"),
 ]
 
 cfilters = [
diff --git a/mercurial/osutil.c b/mercurial/osutil.c
--- a/mercurial/osutil.c
+++ b/mercurial/osutil.c
@@ -515,7 +515,7 @@ bail:
 #endif
 
 #ifdef __APPLE__
-#import <ApplicationServices/ApplicationServices.h>
+#include <ApplicationServices/ApplicationServices.h>
 
 static PyObject *isgui(PyObject *self)
 {