Skip to content

Commit

Permalink
Merge pull request vmg#104 from rstudio/extern-c
Browse files Browse the repository at this point in the history
add extern C declaration when using c++ compiler
  • Loading branch information
vmg committed Apr 4, 2012
2 parents b84697c + ea1b879 commit 6a9a1be
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 0 deletions.
8 changes: 8 additions & 0 deletions html/houdini.h
Expand Up @@ -3,6 +3,10 @@


#include "buffer.h" #include "buffer.h"


#ifdef __cplusplus
extern "C" {
#endif

#ifdef HOUDINI_USE_LOCALE #ifdef HOUDINI_USE_LOCALE
# define _isxdigit(c) isxdigit(c) # define _isxdigit(c) isxdigit(c)
# define _isdigit(c) isdigit(c) # define _isdigit(c) isdigit(c)
Expand All @@ -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_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); extern void houdini_unescape_js(struct buf *ob, const uint8_t *src, size_t size);


#ifdef __cplusplus
}
#endif

#endif #endif
8 changes: 8 additions & 0 deletions html/html.h
Expand Up @@ -21,6 +21,10 @@
#include "buffer.h" #include "buffer.h"
#include <stdlib.h> #include <stdlib.h>


#ifdef __cplusplus
extern "C" {
#endif

struct html_renderopt { struct html_renderopt {
struct { struct {
int header_count; int header_count;
Expand Down Expand Up @@ -65,5 +69,9 @@ sdhtml_toc_renderer(struct sd_callbacks *callbacks, struct html_renderopt *optio
extern void extern void
sdhtml_smartypants(struct buf *ob, const uint8_t *text, size_t size); sdhtml_smartypants(struct buf *ob, const uint8_t *text, size_t size);


#ifdef __cplusplus
}
#endif

#endif #endif


8 changes: 8 additions & 0 deletions src/autolink.h
Expand Up @@ -19,6 +19,10 @@


#include "buffer.h" #include "buffer.h"


#ifdef __cplusplus
extern "C" {
#endif

extern int extern int
sd_autolink_issafe(const uint8_t *link, size_t link_len); sd_autolink_issafe(const uint8_t *link, size_t link_len);


Expand All @@ -31,6 +35,10 @@ sd_autolink__email(size_t *rewind_p, struct buf *link, uint8_t *data, size_t off
extern size_t extern size_t
sd_autolink__url(size_t *rewind_p, struct buf *link, uint8_t *data, size_t offset, size_t size); sd_autolink__url(size_t *rewind_p, struct buf *link, uint8_t *data, size_t offset, size_t size);


#ifdef __cplusplus
}
#endif

#endif #endif


/* vim: set filetype=c: */ /* vim: set filetype=c: */
8 changes: 8 additions & 0 deletions src/buffer.h
Expand Up @@ -22,6 +22,10 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdint.h> #include <stdint.h>


#ifdef __cplusplus
extern "C" {
#endif

#if defined(_MSC_VER) #if defined(_MSC_VER)
#define __attribute__(x) #define __attribute__(x)
#define inline #define inline
Expand Down Expand Up @@ -85,4 +89,8 @@ void bufslurp(struct buf *, size_t);
/* bufprintf: formatted printing to a buffer */ /* bufprintf: formatted printing to a buffer */
void bufprintf(struct buf *, const char *, ...) __attribute__ ((format (printf, 2, 3))); void bufprintf(struct buf *, const char *, ...) __attribute__ ((format (printf, 2, 3)));


#ifdef __cplusplus
}
#endif

#endif #endif
8 changes: 8 additions & 0 deletions src/markdown.h
Expand Up @@ -22,6 +22,10 @@
#include "buffer.h" #include "buffer.h"
#include "autolink.h" #include "autolink.h"


#ifdef __cplusplus
extern "C" {
#endif

#define UPSKIRT_VERSION "1.15.2" #define UPSKIRT_VERSION "1.15.2"
#define UPSKIRT_VER_MAJOR 1 #define UPSKIRT_VER_MAJOR 1
#define UPSKIRT_VER_MINOR 15 #define UPSKIRT_VER_MINOR 15
Expand Down Expand Up @@ -125,6 +129,10 @@ sd_markdown_free(struct sd_markdown *md);
extern void extern void
sd_version(int *major, int *minor, int *revision); sd_version(int *major, int *minor, int *revision);


#ifdef __cplusplus
}
#endif

#endif #endif


/* vim: set filetype=c: */ /* vim: set filetype=c: */
8 changes: 8 additions & 0 deletions src/stack.h
Expand Up @@ -3,6 +3,10 @@


#include <stdlib.h> #include <stdlib.h>


#ifdef __cplusplus
extern "C" {
#endif

struct stack { struct stack {
void **item; void **item;
size_t size; size_t size;
Expand All @@ -18,4 +22,8 @@ int stack_push(struct stack *, void *);
void *stack_pop(struct stack *); void *stack_pop(struct stack *);
void *stack_top(struct stack *); void *stack_top(struct stack *);


#ifdef __cplusplus
}
#endif

#endif #endif

0 comments on commit 6a9a1be

Please sign in to comment.