summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2013-03-27 06:40:36 +0100
committerBardur Arantsson <bardur@scientician.net>2013-09-27 14:46:42 +0200
commit98dea0131750e12a545b3d4efbf6bf945f2f8f6f (patch)
tree2e099197bb6926e0ea551f3bba6222f98edfa95b
parentdc34bf59b8be15e654a902f54387805be69f6fda (diff)
Add __cplusplus conditionals
-rw-r--r--src/dice.h8
-rw-r--r--src/dice_fwd.h8
-rw-r--r--src/range.h8
-rw-r--r--src/range_fwd.h8
-rw-r--r--src/string_list.h8
5 files changed, 40 insertions, 0 deletions
diff --git a/src/dice.h b/src/dice.h
index 3253f348..9b07357e 100644
--- a/src/dice.h
+++ b/src/dice.h
@@ -2,6 +2,10 @@
#include "dice_fwd.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Dice
*/
@@ -11,3 +15,7 @@ struct dice_type
long num; /* Number of dice */
long sides; /* Sides per dice */
};
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/src/dice_fwd.h b/src/dice_fwd.h
index ffc8fbfa..be1ed85f 100644
--- a/src/dice_fwd.h
+++ b/src/dice_fwd.h
@@ -2,6 +2,10 @@
#include "angband.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct dice_type dice_type;
struct dice_type;
@@ -10,3 +14,7 @@ bool_ dice_parse(dice_type *dice, cptr s);
void dice_parse_checked(dice_type *dice, cptr s);
long dice_roll(dice_type *dice);
void dice_print(dice_type *dice, char *buf);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/src/range.h b/src/range.h
index 0d840c18..0cd049dc 100644
--- a/src/range.h
+++ b/src/range.h
@@ -3,6 +3,10 @@
#include "range_fwd.h"
#include "angband.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Range
*/
@@ -13,3 +17,7 @@ struct range_type
};
void range_init(range_type *range, s32b min, s32b max);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/src/range_fwd.h b/src/range_fwd.h
index b5eef3fa..1e76e354 100644
--- a/src/range_fwd.h
+++ b/src/range_fwd.h
@@ -1,4 +1,12 @@
#pragma once
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct range_type range_type;
struct range_type;
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/src/string_list.h b/src/string_list.h
index bd88602f..1d9c2a36 100644
--- a/src/string_list.h
+++ b/src/string_list.h
@@ -3,6 +3,10 @@
#include "sglib.h"
#include "angband.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* String list.
*/
@@ -20,3 +24,7 @@ SGLIB_DEFINE_LIST_PROTOTYPES(string_list, compare_string, next);
void string_list_init(string_list *sl, cptr s); /* Initialize element; copies string */
void string_list_destroy(string_list *sl); /* Destroy element */
void string_list_append(string_list **slist, cptr s); /* Append string */
+
+#ifdef __cplusplus
+} // extern "C"
+#endif