2005-03-03 11:09:27

by Martin Waitz

[permalink] [raw]
Subject: [PATCH 2/16] DocBook: allow preprocessor directives between kernel-doc and function

DocBook: allow preprocessor directives between kernel-doc and function
Signed-off-by: Martin Waitz <[email protected]>


# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.2026 -> 1.2027
# scripts/kernel-doc 1.24 -> 1.25
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 05/01/26 [email protected] 1.2027
# DocBook: allow preprocessor directives between kernel-doc and function
#
# Signed-off-by: Martin Waitz <[email protected]>
# --------------------------------------------
#
diff -Nru a/scripts/kernel-doc b/scripts/kernel-doc
--- a/scripts/kernel-doc Thu Mar 3 11:41:25 2005
+++ b/scripts/kernel-doc Thu Mar 3 11:41:25 2005
@@ -1578,13 +1578,13 @@
my $x = shift;
my $file = shift;

- if ($x =~ m#\s*/\*\s+MACDOC\s*#io) {
+ if ($x =~ m#\s*/\*\s+MACDOC\s*#io || ($x =~ /^#/ && $x !~ /^#define/)) {
# do nothing
}
elsif ($x =~ /([^\{]*)/) {
$prototype .= $1;
}
- if (($x =~ /\{/) || ($x =~ /\#/) || ($x =~ /;/)) {
+ if (($x =~ /\{/) || ($x =~ /\#define/) || ($x =~ /;/)) {
$prototype =~ s@/\*.*?\*/@@gos; # strip comments.
$prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
$prototype =~ s@^\s+@@gos; # strip leading spaces