summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac7
-rw-r--r--src/Makefile.am5
-rw-r--r--src/common.h2
-rw-r--r--src/macro.h10
-rw-r--r--src/sydney.h14
5 files changed, 32 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 3d77e70..330e3fa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,10 @@ AM_PROG_CC_C_O
AC_PROG_GCC_TRADITIONAL
AC_GNU_SOURCE
+# C++
+
+AC_PROG_CXX
+
# GCC flags
test_gcc_flag() {
@@ -67,6 +71,7 @@ if test "x$GCC" = "xyes" ; then
AC_MSG_CHECKING([whether $CC accepts $flag])
if test_gcc_flag $flag ; then
CFLAGS="$CFLAGS $flag"
+ CXXFLAGS="$CXXFLAGS $flag"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
@@ -367,6 +372,8 @@ echo "
localstatedir: ${localstatedir}
Compiler: ${CC}
CFLAGS: ${CFLAGS}
+ C++-Compiler: ${CXX}
+ CXXFLAGS: ${CXXFLAGS}
Enable OSS: ${ENABLE_OSS}
Enable Alsa: ${ENABLE_ALSA}
Enable Solaris: ${ENABLE_SOLARIS}
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