Browse files

add extern C declaration when using c++ compiler

  • Loading branch information...
1 parent b84697c commit ea1b87928c067368632a466df7f4d6d9c7e29667 @jjallaire jjallaire committed Apr 4, 2012
Showing with 48 additions and 0 deletions.
  1. +8 −0 html/houdini.h
  2. +8 −0 html/html.h
  3. +8 −0 src/autolink.h
  4. +8 −0 src/buffer.h
  5. +8 −0 src/markdown.h
  6. +8 −0 src/stack.h
View
8 html/houdini.h
@@ -3,6 +3,10 @@
#include "buffer.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef HOUDINI_USE_LOCALE
# define _isxdigit(c) isxdigit(c)
# define _isdigit(c) isdigit(c)
@@ -26,4 +30,8 @@ extern void houdini_unescape_url(struct buf *ob, const uint8_t *src, size_t size
extern void houdini_escape_js(struct buf *ob, const uint8_t *src, size_t size);
extern void houdini_unescape_js(struct buf *ob, const uint8_t *src, size_t size);
+#ifdef __cplusplus
+}
+#endif
+
#endif
View
8 html/html.h
@@ -21,6 +21,10 @@
#include "buffer.h"
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct html_renderopt {
struct {
int header_count;
@@ -65,5 +69,9 @@ sdhtml_toc_renderer(struct sd_callbacks *callbacks, struct html_renderopt *optio
extern void
sdhtml_smartypants(struct buf *ob, const uint8_t *text, size_t size);
+#ifdef __cplusplus
+}
+#endif
+
#endif
View
8 src/autolink.h
@@ -19,6 +19,10 @@
#include "buffer.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern int
sd_autolink_issafe(const uint8_t *link, size_t link_len);
@@ -31,6 +35,10 @@ sd_autolink__email(size_t *rewind_p, struct buf *link, uint8_t *data, size_t off
extern size_t
sd_autolink__url(size_t *rewind_p, struct buf *link, uint8_t *data, size_t offset, size_t size);
+#ifdef __cplusplus
+}
+#endif
+
#endif
/* vim: set filetype=c: */
View
8 src/buffer.h
@@ -22,6 +22,10 @@
#include <stdarg.h>
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if defined(_MSC_VER)
#define __attribute__(x)
#define inline
@@ -85,4 +89,8 @@ void bufslurp(struct buf *, size_t);
/* bufprintf: formatted printing to a buffer */
void bufprintf(struct buf *, const char *, ...) __attribute__ ((format (printf, 2, 3)));
+#ifdef __cplusplus
+}
+#endif
+
#endif
View
8 src/markdown.h
@@ -22,6 +22,10 @@
#include "buffer.h"
#include "autolink.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define UPSKIRT_VERSION "1.15.2"
#define UPSKIRT_VER_MAJOR 1
#define UPSKIRT_VER_MINOR 15
@@ -125,6 +129,10 @@ sd_markdown_free(struct sd_markdown *md);
extern void
sd_version(int *major, int *minor, int *revision);
+#ifdef __cplusplus
+}
+#endif
+
#endif
/* vim: set filetype=c: */
View
8 src/stack.h
@@ -3,6 +3,10 @@
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct stack {
void **item;
size_t size;
@@ -18,4 +22,8 @@ int stack_push(struct stack *, void *);
void *stack_pop(struct stack *);
void *stack_top(struct stack *);
+#ifdef __cplusplus
+}
+#endif
+
#endif

0 comments on commit ea1b879

Please sign in to comment.