summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-08-19 11:18:52 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-08-19 11:18:52 +0200
commita971614a9150ce906b8448fee544041f009117b8 (patch)
treedf870da8deb74bae6b27cb31d108868b474c0f20
parent69355c3ce3931a7ae6bf9e6cc2e13442190246d8 (diff)
downloadrtems-libbsd-a971614a9150ce906b8448fee544041f009117b8.tar.bz2
doc: Update rules to modify FreeBSD code
-rw-r--r--libbsd.txt30
1 files changed, 30 insertions, 0 deletions
diff --git a/libbsd.txt b/libbsd.txt
index f4b07460..6b9e2a91 100644
--- a/libbsd.txt
+++ b/libbsd.txt
@@ -625,6 +625,36 @@ include a `__rtems__` in the guards to make searches easy, so use
* `#else /* __rtems__ */`, and
* `#endif /* __rtems__ */`.
+The guards must start at the begin of the line. Examples for wrong guards:
+
+-------------------------------------------------------------------------------
+static void
+guards_must_start_at_the_begin_of_the_line(int j)
+{
+
+ #ifdef __rtems__
+ return (j + 1);
+ #else /* __rtems__ */
+ return (j + 2);
+ #endif /* __rtems__ */
+}
+
+static void
+missing_rtems_comments_in_the_guards(int j)
+{
+
+#ifdef __rtems__
+ return (j + 3);
+#else
+ return (j + 4);
+#endif
+}
+-------------------------------------------------------------------------------
+
+Do not disable option header includes via guards. Instead, add an empty option
+header, e.g. `rtemsbsd/include/rtems/bsd/local/opt_xyz.h`. In general, provide
+empty header files and do not guard includes.
+
For new code use
http://www.freebsd.org/cgi/man.cgi?query=style&apropos=0&sektion=9&manpath=FreeBSD+9.2-RELEASE&arch=default&format=html[STYLE(9)].
Do not format original FreeBSD code.