From 841719d5c4d62f3465252f4e302956e845ed3c63 Mon Sep 17 00:00:00 2001 From: hadaq Date: Mon, 26 Apr 2010 00:03:07 +0000 Subject: [PATCH] c++ ready --- libtrbnet/trberror.h | 8 ++++++++ libtrbnet/trbnet.c | 14 +++++++------- libtrbnet/trbnet.h | 7 +++++++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/libtrbnet/trberror.h b/libtrbnet/trberror.h index de40459..5f1dc35 100644 --- a/libtrbnet/trberror.h +++ b/libtrbnet/trberror.h @@ -3,6 +3,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { TRB_NONE = 0, TRB_TX_BUSY = 1, @@ -52,4 +56,8 @@ extern TRB_TERM trb_term; const char* trb_strterm(TRB_TERM term); +#ifdef __cplusplus +} +#endif + #endif diff --git a/libtrbnet/trbnet.c b/libtrbnet/trbnet.c index 66ffcce..01b5c4b 100644 --- a/libtrbnet/trbnet.c +++ b/libtrbnet/trbnet.c @@ -1,4 +1,4 @@ -const char trbnet_version[] = "$Revision: 2.60 $"; +const char trbnet_version[] = "$Revision: 2.61 $"; #include #include @@ -1034,12 +1034,12 @@ int init_ports() return -1; } - mem = mmap((void*)0, - 2 * 4 * 4 * 8192, - PROT_READ | PROT_WRITE, - MAP_SHARED, - memfd, - 0xb0000000); + mem = (uint32_t*)mmap((void*)0, + 2 * 4 * 4 * 8192, + PROT_READ | PROT_WRITE, + MAP_SHARED, + memfd, + 0xb0000000); if ((void*)mem == MAP_FAILED) { trb_errno = TRB_FIFO_SHARED_MEM; diff --git a/libtrbnet/trbnet.h b/libtrbnet/trbnet.h index 82062aa..afa1c06 100644 --- a/libtrbnet/trbnet.h +++ b/libtrbnet/trbnet.h @@ -10,6 +10,10 @@ extern unsigned int trb_debug; extern unsigned int trb_dma; extern FILE* trb_stderr; +#ifdef __cplusplus +extern "C" { +#endif + /* ---------------------------------------------------------------------- */ int init_ports(); @@ -233,5 +237,8 @@ int com_reset(); uint16_t number); */ +#ifdef __cplusplus +} +#endif #endif -- 2.43.0