support C++ in build

This commit is contained in:
josh committed 2018-05-08 19:55:40 -04:00
1 parent 600d01193c
commit 8733911e82
6 files changed
+35 -4

No files matched your search

+8
View File
@@ -3,6 +3,10 @@
#include "String.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
int type;
@@ -24,4 +28,8 @@ enum
Node * Node_new(int type);
#ifdef __cplusplus
}
#endif
#endif
+8
View File
@@ -3,6 +3,10 @@
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
char * value;
@@ -17,4 +21,8 @@ static inline char * String_cstr(const String * st) { return st->value; }
static inline size_t String_size(const String * st) { return st->size; }
void String_free(String * st);
#ifdef __cplusplus
}
#endif
#endif
@@ -10,6 +10,7 @@ extern FILE * yyin;
static const char * input_fname;
extern "C" {
void parse(const char * filename)
{
input_fname = filename;
@@ -25,6 +26,7 @@ void parse(const char * filename)
return;
}
}
}
static char * read_file(const char * filename, size_t * length)
{
+10 -1
View File
@@ -2,11 +2,20 @@
#define PARSER_H
#include "Node.h"
#include "parser.tab.h"
#include "parser.tab.hh"
#define YYSTYPE Node *
#ifdef __cplusplus
extern "C" {
#endif
void parse(const char * filename);
#ifdef __cplusplus
}
#endif
void handle_parse_error(const char * str, const YYLTYPE * yylloc);
#endif
File renamed without changes.