source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: In private header files, __BEGIN_DECLS and __END_DECLS are
@ 2015-11-07 14:01 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2015-11-07 14:01 UTC (permalink / raw)
  To: source

Log Message:
-----------
In private header files, __BEGIN_DECLS and __END_DECLS are pointless.
Because these work slightly differently on different systems,
they are becoming a maintenance burden in the portable version,
so delete them.

Besides, one of the chief design goals of the mandoc toolbox is to 
make sure that nothing related to documentation requires C++.
Consequently, linking mandoc against any kind of C++ program would
defeat the purpose and is not supported.
I don't understand why kristaps@ added them in the first place.

Modified Files:
--------------
    mdocml:
        INSTALL
        compat_fts.h
        compat_ohash.h
        compat_stringlist.h
        configure
        html.h
        libman.h
        libmandoc.h
        libmdoc.h
        libroff.h
        main.h
        man.h
        manconf.h
        mandoc.h
        mandoc_aux.h
        mandoc_ohash.h
        mansearch.h
        mdoc.h
        out.h
        roff.h
        roff_int.h
        tag.h
        term.h

Revision Data
-------------
Index: libmandoc.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/libmandoc.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -Llibmandoc.h -Llibmandoc.h -u -p -r1.61 -r1.62
--- libmandoc.h
+++ libmandoc.h
@@ -32,7 +32,6 @@ struct	buf {
 	size_t	 sz;
 };
 
-__BEGIN_DECLS
 
 struct	mparse;
 struct	tbl_span;
@@ -84,5 +83,3 @@ int		 roff_getformat(const struct roff *
 
 const struct tbl_span	*roff_span(const struct roff *);
 const struct eqn	*roff_eqn(const struct roff *);
-
-__END_DECLS
Index: html.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/html.h,v
retrieving revision 1.71
retrieving revision 1.72
diff -Lhtml.h -Lhtml.h -u -p -r1.71 -r1.72
--- html.h
+++ html.h
@@ -142,7 +142,6 @@ struct	html {
 #define	HTML_FRAGMENT	 (1 << 0) /* don't emit HTML/HEAD/BODY */
 };
 
-__BEGIN_DECLS
 
 struct	tbl_span;
 struct	eqn;
@@ -175,5 +174,3 @@ void		  buffmt_man(struct html *,
 void		  buffmt_includes(struct html *, const char *);
 
 int		  html_strlen(const char *);
-
-__END_DECLS
Index: man.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/man.h,v
retrieving revision 1.76
retrieving revision 1.77
diff -Lman.h -Lman.h -u -p -r1.76 -r1.77
--- man.h
+++ man.h
@@ -59,11 +59,8 @@
 /* Names of macros. */
 extern	const char *const *man_macronames;
 
-__BEGIN_DECLS
 
 struct	roff_man;
 
 const struct mparse	*man_mparse(const struct roff_man *);
 void			 man_validate(struct roff_man *);
-
-__END_DECLS
Index: manconf.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/manconf.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lmanconf.h -Lmanconf.h -u -p -r1.1 -r1.2
--- manconf.h
+++ manconf.h
@@ -42,10 +42,7 @@ struct	manconf {
 	struct manpaths		  manpath;
 };
 
-__BEGIN_DECLS
 
 void	 manconf_parse(struct manconf *, const char *, char *, char *);
 void	 manconf_output(struct manoutput *, const char *);
 void	 manconf_free(struct manconf *);
-
-__END_DECLS
Index: mandoc_ohash.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mandoc_ohash.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lmandoc_ohash.h -Lmandoc_ohash.h -u -p -r1.1 -r1.2
--- mandoc_ohash.h
+++ mandoc_ohash.h
@@ -20,8 +20,4 @@
 #include "compat_ohash.h"
 #endif
 
-__BEGIN_DECLS
-
 void		  mandoc_ohash_init(struct ohash *, unsigned int, ptrdiff_t);
-
-__END_DECLS
Index: out.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/out.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -Lout.h -Lout.h -u -p -r1.26 -r1.27
--- out.h
+++ out.h
@@ -60,12 +60,9 @@ struct	rofftbl {
 	     (p)->scale = (v); } \
 	while (/* CONSTCOND */ 0)
 
-__BEGIN_DECLS
 
 struct	tbl_span;
 
 int		  a2roffsu(const char *, struct roffsu *, enum roffscale);
 void		  tblcalc(struct rofftbl *tbl,
 			const struct tbl_span *, size_t);
-
-__END_DECLS
Index: mandoc.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mandoc.h,v
retrieving revision 1.207
retrieving revision 1.208
diff -Lmandoc.h -Lmandoc.h -u -p -r1.207 -r1.208
--- mandoc.h
+++ mandoc.h
@@ -408,7 +408,6 @@ enum	mandoc_esc {
 typedef	void	(*mandocmsg)(enum mandocerr, enum mandoclevel,
 			const char *, int, int, const char *);
 
-__BEGIN_DECLS
 
 struct	mparse;
 struct	roff_man;
@@ -434,5 +433,3 @@ void		  mparse_result(struct mparse *,
 const char	 *mparse_getkeep(const struct mparse *);
 const char	 *mparse_strerror(enum mandocerr);
 const char	 *mparse_strlevel(enum mandoclevel);
-
-__END_DECLS
Index: term.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/term.h,v
retrieving revision 1.117
retrieving revision 1.118
diff -Lterm.h -Lterm.h -u -p -r1.117 -r1.118
--- term.h
+++ term.h
@@ -105,7 +105,6 @@ struct	termp {
 	struct termp_ps	 *ps;
 };
 
-__BEGIN_DECLS
 
 struct	tbl_span;
 struct	eqn;
@@ -134,5 +133,3 @@ void		  term_fontpop(struct termp *);
 void		  term_fontpopq(struct termp *, int);
 void		  term_fontrepl(struct termp *, enum termfont);
 void		  term_fontlast(struct termp *);
-
-__END_DECLS
Index: libroff.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/libroff.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -Llibroff.h -Llibroff.h -u -p -r1.38 -r1.39
--- libroff.h
+++ libroff.h
@@ -60,7 +60,6 @@ struct	eqn_def {
 	size_t		  valsz;
 };
 
-__BEGIN_DECLS
 
 struct tbl_node	*tbl_alloc(int, int, struct mparse *);
 void		 tbl_restart(int, int, struct tbl_node *);
@@ -78,5 +77,3 @@ enum rofferr	 eqn_end(struct eqn_node **
 void		 eqn_free(struct eqn_node *);
 enum rofferr	 eqn_read(struct eqn_node **, int,
 			const char *, int, int *);
-
-__END_DECLS
Index: compat_stringlist.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/compat_stringlist.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lcompat_stringlist.h -Lcompat_stringlist.h -u -p -r1.3 -r1.4
--- compat_stringlist.h
+++ compat_stringlist.h
@@ -38,9 +38,8 @@ typedef struct _stringlist {
 	size_t	  sl_cur;
 } StringList;
 
-__BEGIN_DECLS
+
 StringList *sl_init(void);
 int	 sl_add(StringList *, char *);
 void	 sl_free(StringList *, int);
 char	*sl_find(StringList *, const char *);
-__END_DECLS
Index: compat_ohash.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/compat_ohash.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -Lcompat_ohash.h -Lcompat_ohash.h -u -p -r1.5 -r1.6
--- compat_ohash.h
+++ compat_ohash.h
@@ -49,7 +49,6 @@ struct ohash {
  * a hashing table index (opaque) to be used in find/insert/remove.
  * The keys are stored at a known position in the client data.
  */
-__BEGIN_DECLS
 void ohash_init(struct ohash *, unsigned, struct ohash_info *);
 void ohash_delete(struct ohash *);
 
@@ -69,5 +68,5 @@ uint32_t ohash_interval(const char *, co
 
 unsigned int ohash_qlookupi(struct ohash *, const char *, const char **);
 unsigned int ohash_qlookup(struct ohash *, const char *);
-__END_DECLS
+
 #endif
Index: libmdoc.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/libmdoc.h,v
retrieving revision 1.107
retrieving revision 1.108
diff -Llibmdoc.h -Llibmdoc.h -u -p -r1.107 -r1.108
--- libmdoc.h
+++ libmdoc.h
@@ -62,7 +62,6 @@ enum	mdelim {
 
 extern	const struct mdoc_macro *const mdoc_macros;
 
-__BEGIN_DECLS
 
 void		  mdoc_macro(MACRO_PROT_ARGS);
 void		  mdoc_elem_alloc(struct roff_man *, int, int,
@@ -87,5 +86,3 @@ void		  mdoc_argv(struct roff_man *, int
 enum margserr	  mdoc_args(struct roff_man *, int,
 			int *, char *, int, char **);
 enum mdelim	  mdoc_isdelim(const char *);
-
-__END_DECLS
Index: roff_int.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/roff_int.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -Lroff_int.h -Lroff_int.h -u -p -r1.6 -r1.7
--- roff_int.h
+++ roff_int.h
@@ -16,8 +16,6 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-__BEGIN_DECLS
-
 struct roff_node *roff_node_alloc(struct roff_man *, int, int,
 			enum roff_type, int);
 void		  roff_node_append(struct roff_man *, struct roff_node *);
@@ -41,5 +39,3 @@ void		  roff_node_delete(struct roff_man
 
 void		  man_breakscope(struct roff_man *, int);
 void		  mdoc_argv_free(struct mdoc_arg *);
-
-__END_DECLS
Index: tag.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/tag.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -Ltag.h -Ltag.h -u -p -r1.5 -r1.6
--- tag.h
+++ tag.h
@@ -22,11 +22,8 @@ struct	tag_files {
 	int	 tfd;
 };
 
-__BEGIN_DECLS
 
 struct tag_files *tag_init(void);
 void	 tag_put(const char *, int, size_t);
 void	 tag_write(void);
 void	 tag_unlink(void);
-
-__END_DECLS
Index: mdoc.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc.h,v
retrieving revision 1.143
retrieving revision 1.144
diff -Lmdoc.h -Lmdoc.h -u -p -r1.143 -r1.144
--- mdoc.h
+++ mdoc.h
@@ -280,8 +280,5 @@ extern	const char *const *mdoc_macroname
 /* Names of macro args.  Index is enum mdocargt. */
 extern	const char *const *mdoc_argnames;
 
-__BEGIN_DECLS
 
 void		 mdoc_validate(struct roff_man *);
-
-__END_DECLS
Index: main.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/main.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -Lmain.h -Lmain.h -u -p -r1.23 -r1.24
--- main.h
+++ main.h
@@ -18,8 +18,6 @@
 
 #define	UNCONST(a)	((void *)(uintptr_t)(const void *)(a))
 
-__BEGIN_DECLS
-
 struct	roff_man;
 struct	manoutput;
 
@@ -53,5 +51,3 @@ void		  pspdf_free(void *);
 
 void		  terminal_mdoc(void *, const struct roff_man *);
 void		  terminal_man(void *, const struct roff_man *);
-
-__END_DECLS
Index: mandoc_aux.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mandoc_aux.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lmandoc_aux.h -Lmandoc_aux.h -u -p -r1.3 -r1.4
--- mandoc_aux.h
+++ mandoc_aux.h
@@ -16,8 +16,6 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-__BEGIN_DECLS
-
 int		  mandoc_asprintf(char **, const char *, ...);
 void		 *mandoc_calloc(size_t, size_t);
 void		 *mandoc_malloc(size_t);
@@ -25,5 +23,3 @@ void		 *mandoc_realloc(void *, size_t);
 void		 *mandoc_reallocarray(void *, size_t, size_t);
 char		 *mandoc_strdup(const char *);
 char		 *mandoc_strndup(const char *, size_t);
-
-__END_DECLS
Index: configure
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure,v
retrieving revision 1.32
retrieving revision 1.33
diff -Lconfigure -Lconfigure -u -p -r1.32 -r1.33
--- configure
+++ configure
@@ -276,6 +276,10 @@ fi
 exec > config.h
 
 cat << __HEREDOC__
+#ifdef __cplusplus
+#error "Do not use C++.  See the INSTALL file."
+#endif
+
 #ifndef MANDOC_CONFIG_H
 #define MANDOC_CONFIG_H
 
@@ -330,21 +334,6 @@ cat << __HEREDOC__
 #define BINM_MAN "${BINM_MAN}"
 #define BINM_SOELIM "${BINM_SOELIM}"
 #define BINM_WHATIS "${BINM_WHATIS}"
-
-#if !defined(__BEGIN_DECLS)
-#  ifdef __cplusplus
-#  define	__BEGIN_DECLS		extern "C" {
-#  else
-#  define	__BEGIN_DECLS
-#  endif
-#endif
-#if !defined(__END_DECLS)
-#  ifdef __cplusplus
-#  define	__END_DECLS		}
-#  else
-#  define	__END_DECLS
-#  endif
-#endif
 
 __HEREDOC__
 
Index: mansearch.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mansearch.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -Lmansearch.h -Lmansearch.h -u -p -r1.23 -r1.24
--- mansearch.h
+++ mansearch.h
@@ -95,7 +95,6 @@ struct	mansearch {
 	int		 firstmatch; /* first matching database only */
 };
 
-__BEGIN_DECLS
 
 struct	manpaths;
 
@@ -107,5 +106,3 @@ int	mansearch(const struct mansearch *cf
 		struct manpage **res, /* results */
 		size_t *ressz); /* results returned */
 void	mansearch_free(struct manpage *, size_t);
-
-__END_DECLS
Index: roff.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/roff.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -Lroff.h -Lroff.h -u -p -r1.35 -r1.36
--- roff.h
+++ roff.h
@@ -161,8 +161,5 @@ struct	roff_man {
 	enum roff_next	  next;    /* Where to put the next node. */
 };
 
-__BEGIN_DECLS
 
 void		 deroff(char **, const struct roff_node *);
-
-__END_DECLS
Index: libman.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/libman.h,v
retrieving revision 1.78
retrieving revision 1.79
diff -Llibman.h -Llibman.h -u -p -r1.78 -r1.79
--- libman.h
+++ libman.h
@@ -34,11 +34,8 @@ struct	man_macro {
 
 extern	const struct man_macro *const man_macros;
 
-__BEGIN_DECLS
 
 int		  man_hash_find(const char *);
 void		  man_node_validate(struct roff_man *);
 void		  man_state(struct roff_man *, struct roff_node *);
 void		  man_unscope(struct roff_man *, const struct roff_node *);
-
-__END_DECLS
Index: INSTALL
===================================================================
RCS file: /home/cvs/mdocml/mdocml/INSTALL,v
retrieving revision 1.12
retrieving revision 1.13
diff -LINSTALL -LINSTALL -u -p -r1.12 -r1.13
--- INSTALL
+++ INSTALL
@@ -110,6 +110,11 @@ If you run into that problem, set "HAVE_
 If your system does not have it, the bundled compatibility version
 will be used, so you probably need not worry about it.
 
+One of the chief design goals of the mandoc toolbox is to make
+sure that nothing related to documentation requires C++.
+Consequently, linking mandoc against any kind of C++ program
+would defeat the purpose and is not supported.
+
 
 Checking autoconfiguration quality
 ----------------------------------
Index: compat_fts.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/compat_fts.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lcompat_fts.h -Lcompat_fts.h -u -p -r1.2 -r1.3
--- compat_fts.h
+++ compat_fts.h
@@ -92,11 +92,10 @@ typedef struct _ftsent {
 	char fts_name[1];		/* file name */
 } FTSENT;
 
-__BEGIN_DECLS
+
 int	 fts_close(FTS *);
 FTS	*fts_open(char * const *, int, void *);
 FTSENT	*fts_read(FTS *);
 int	 fts_set(FTS *, FTSENT *, int);
-__END_DECLS
 
 #endif /* !_FTS_H_ */
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-07 14:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-07 14:01 mdocml: In private header files, __BEGIN_DECLS and __END_DECLS are schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).