aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2014-08-22 20:04:51 +0000
committerXin LI <delphij@FreeBSD.org>2014-08-22 20:04:51 +0000
commit4ddb46f694a0db537f093297b7d00b46181aa00e (patch)
tree8a5d6970efa63e0664d1bca3c052d034cea31c9e
parentd77e67e495266d993f07d5b20822faf127bd1948 (diff)
downloadsrc-4ddb46f694a0db537f093297b7d00b46181aa00e.tar.gz
src-4ddb46f694a0db537f093297b7d00b46181aa00e.zip
Make DTrace stuff compile with C99 standard.
Notes
Notes: svn path=/head/; revision=270358
-rw-r--r--cddl/Makefile.inc1
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h5
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c5
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c1
-rw-r--r--cddl/contrib/opensolaris/lib/libgen/common/gmatch.c1
-rw-r--r--cddl/lib/libdtrace/libproc_compat.h1
-rw-r--r--cddl/usr.sbin/lockstat/Makefile1
7 files changed, 13 insertions, 2 deletions
diff --git a/cddl/Makefile.inc b/cddl/Makefile.inc
index 9ebb86bffc5b..94a42492a4f0 100644
--- a/cddl/Makefile.inc
+++ b/cddl/Makefile.inc
@@ -8,7 +8,6 @@ IGNORE_PRAGMA= YES
CFLAGS+= -DNEED_SOLARIS_BOOLEAN
WARNS?= 6
-CSTD?= gnu89
# Do not lint the CDDL stuff. It is all externally maintained and
# lint output is wasteful noise here.
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
index b7abbc2fddc9..8cf5fe2d140b 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
@@ -723,6 +723,11 @@ extern int _dtrace_argmax; /* default maximum probe arguments */
extern const char *_dtrace_libdir; /* default library directory */
extern const char *_dtrace_moddir; /* default kernel module directory */
+#ifdef __FreeBSD__
+extern int gmatch(const char *, const char *);
+extern int yylex(void);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
index f6c140bdeec8..0eb2a2cdcc2f 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
@@ -29,6 +29,11 @@
#if defined(sun)
#include <sys/modctl.h>
#include <sys/systeminfo.h>
+#else
+/* FreeBSD */
+#include <sys/param.h>
+#include <sys/module.h>
+#include <sys/linker.h>
#endif
#include <sys/resource.h>
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c
index 760c2f675788..7f49f640a944 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c
@@ -36,6 +36,7 @@
#include <stdio.h>
#include <sys/types.h>
+#include <sys/sysctl.h>
#include <sys/stat.h>
#include <dt_parser.h>
diff --git a/cddl/contrib/opensolaris/lib/libgen/common/gmatch.c b/cddl/contrib/opensolaris/lib/libgen/common/gmatch.c
index fe4a3825a7a6..199fbb356036 100644
--- a/cddl/contrib/opensolaris/lib/libgen/common/gmatch.c
+++ b/cddl/contrib/opensolaris/lib/libgen/common/gmatch.c
@@ -42,6 +42,7 @@
#include <widec.h>
#include "_range.h"
#else
+#include <ctype.h>
/* DOODAD */ static int multibyte = 0;
#define WCHAR_CSMASK 0x30000000
#define valid_range(c1, c2) \
diff --git a/cddl/lib/libdtrace/libproc_compat.h b/cddl/lib/libdtrace/libproc_compat.h
index 7e54ada6bf94..84433362d0c5 100644
--- a/cddl/lib/libdtrace/libproc_compat.h
+++ b/cddl/lib/libdtrace/libproc_compat.h
@@ -43,6 +43,7 @@
#define Pcreate_error strerror
#define Pdelbkpt proc_bkptdel
#define Pgrab_error strerror
+#define Plmid(p, a, l) (-1)
#define Plmid_to_map(p, l, o) proc_obj2map((p), (o))
#define Plookup_by_addr proc_addr2sym
#define Pname_to_ctf(p, obj) NULL
diff --git a/cddl/usr.sbin/lockstat/Makefile b/cddl/usr.sbin/lockstat/Makefile
index 499b23db23b8..0668758c2f97 100644
--- a/cddl/usr.sbin/lockstat/Makefile
+++ b/cddl/usr.sbin/lockstat/Makefile
@@ -18,7 +18,6 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
-I${.CURDIR}/../../../sys
CFLAGS+= -DNEED_ERRLOC -g
-CSTD?= gnu99
#YFLAGS+= -d