summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am5
-rw-r--r--src/common.h2
-rw-r--r--src/macro.h10
-rw-r--r--src/sydney.h14
4 files changed, 25 insertions, 6 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index ad13181..a465b44 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -17,6 +17,7 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
AM_CFLAGS = $(PTHREAD_CFLAGS)
+AM_CXXFLAGS = $(PTHREAD_CFLAGS)
AM_LIBADD = $(PTHREAD_LIBS)
AM_LDADD = $(PTHREAD_LIBS)
@@ -57,8 +58,8 @@ libsydney_la_SOURCES = \
libsydney_la_LIBADD = \
$(AM_LIBADD) \
$(LIBOIL_LIBS)
-libsydney_la_CFLAGS = \
- $(AM_CFLAGS) \
+libsydney_la_CXXFLAGS = \
+ $(AM_CXXFLAGS) \
$(LIBOIL_CFLAGS) \
-DRANDOM_PREFIX=saspeex -DOUTSIDE_SPEEX
diff --git a/src/common.h b/src/common.h
index 63fc991..9d01c44 100644
--- a/src/common.h
+++ b/src/common.h
@@ -53,7 +53,7 @@ struct sa_stream {
sa_notify_t notify;
sa_event_t event;
- void *private; /* driver specific data */
+ void *driver_data; /* driver specific data */
void *meta_data[_META_NAMES_MAX];
size_t meta_data_size[_META_NAMES_MAX];
diff --git a/src/macro.h b/src/macro.h
index 4f2d018..30a7be4 100644
--- a/src/macro.h
+++ b/src/macro.h
@@ -105,4 +105,14 @@ typedef void (*sa_free_cb_t)(void *);
typedef int sa_bool_t;
+/* Guard C code in headers, while including them from C++ */
+#ifdef __cplusplus
+# define SA_BEGIN_DECLS extern "C" {
+# define SA_END_DECLS }
+#else
+# define SA_BEGIN_DECLS
+# define SA_END_DECLS
+#endif
+
+
#endif
diff --git a/src/sydney.h b/src/sydney.h
index 00887f9..eb1a7ec 100644
--- a/src/sydney.h
+++ b/src/sydney.h
@@ -1,6 +1,10 @@
#ifndef foosydneyhfoo
#define foosydneyhfoo
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Requirements:
- In sync mode, the device will automatically write data so that an initial read causes writes
@@ -88,7 +92,7 @@ typedef enum {
SA_MODE_WRONLY = 1,
SA_MODE_RDONLY = 2,
SA_MODE_RDWR = 3,
- _SA_MODE_MAX = 4,
+ _SA_MODE_MAX = 4
} sa_mode_t;
/** Error codes */
@@ -205,7 +209,7 @@ typedef enum {
SA_STATE_RUNNING,
SA_STATE_STOPPED,
/* put more stuff */
- _SA_STATE_MAX,
+ _SA_STATE_MAX
} sa_state_t;
typedef enum {
@@ -217,7 +221,7 @@ typedef enum {
typedef enum {
SA_ADJUST_UP = 1,
SA_ADJUST_DOWN = -1,
- SA_ADJUST_NONE = 0,
+ SA_ADJUST_NONE = 0
} sa_adjust_t;
/* Some kind of meta information. */
@@ -375,4 +379,8 @@ int sa_stream_drain(sa_stream_t *s);
/** Return a human readable error */
const char *sa_strerror(int code);
+#ifdef __cplusplus
+}
+#endif
+
#endif