Commit f42612be authored by Felix Hamann's avatar Felix Hamann

added C++ header guards

closes #27
parent 42289f7e
......@@ -28,6 +28,11 @@
#include <assert.h>
#ifdef __cplusplus
extern "C" {
#endif
#define UU __attribute__((unused))
......@@ -81,4 +86,8 @@ samwise_destroy (
samwise_t **self);
#ifdef __cplusplus
}
#endif
#endif
......@@ -91,20 +91,6 @@ if (condition) {
}
```
C++ is not going to be supported. It is not needed to wrap code in statements like
```C
#ifdef __cplusplus
extern "C" {
#endif
// ...
#ifdef __cplusplus
}
#endif
```
### Additional Conventions ###
As far as possible, code and documentation should never exceed 80 characters per line. The code documentation gets rendered by doxygen with the java style syntax using the `@` prefix. Doxygen and CLASS -style comments are getting mixed.
......
......@@ -21,6 +21,10 @@
#ifndef __SAM_H__
#define __SAM_H__
#ifdef __cplusplus
extern "C" {
#endif
#define SAM_VERSION_MAJOR 0
#define SAM_VERSION_MINOR 0
......@@ -145,4 +149,8 @@ void *
sam_test ();
#ifdef __cplusplus
}
#endif
#endif
......@@ -22,6 +22,10 @@
#ifndef __SAM_BE_RMQ_H__
#define __SAM_BE_RMQ_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct sam_be_rmq_t sam_be_rmq_t;
......@@ -166,4 +170,8 @@ void *
sam_be_rmq_test ();
#ifdef __cplusplus
}
#endif
#endif
......@@ -20,6 +20,10 @@
#ifndef __SAM_BUF_H__
#define __SAM_BUF_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct sam_buf_t sam_buf_t;
......@@ -64,4 +68,8 @@ void *
sam_buf_test ();
#ifdef __cplusplus
}
#endif
#endif
......@@ -17,10 +17,15 @@
*/
#ifndef __SAM_CFG_H__
#define __SAM_CFG_H__
#ifdef __cplusplus
extern "C" {
#endif
// --------------------------------------------------------------------------
/// @brief Create a new cfg instance
......@@ -154,4 +159,8 @@ void *
sam_cfg_test ();
#ifdef __cplusplus
}
#endif
#endif
......@@ -21,6 +21,10 @@
#ifndef __SAM_DB_H__
#define __SAM_DB_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct sam_db_t sam_db_t;
......@@ -170,4 +174,8 @@ void *
sam_db_test ();
#ifdef __cplusplus
}
#endif
#endif
......@@ -19,6 +19,8 @@
#define __SAM_GEN_H__
// --------------------------------------------------------------------------
/// @brief Generic pipe handler for zactors reacting to interrupts and $TERM
/// @return -1 in case of termination, 0 otherwise
......@@ -35,4 +37,8 @@ void *
sam_gen_test ();
#ifdef __cplusplus
}
#endif
#endif
......@@ -22,6 +22,10 @@
#ifndef _SAM_LOG_H_
#define _SAM_LOG_H_
#ifdef __cplusplus
extern "C" {
#endif
/// The different severity levels for logging
typedef enum {
......@@ -126,4 +130,8 @@ sam_log_test ();
#endif
#ifdef __cplusplus
}
#endif
#endif
......@@ -22,6 +22,10 @@
#ifndef __SAM_MSG_H__
#define __SAM_MSG_H__
#ifdef __cplusplus
extern "C" {
#endif
// rules for expect ()'s variadic arguments
typedef enum {
......@@ -157,4 +161,8 @@ void *
sam_msg_test ();
#ifdef __cplusplus
}
#endif
#endif
......@@ -21,6 +21,10 @@
#ifndef __SAM_PRELUDE_H__
#define __SAM_PRELUDE_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct sam_backend_t sam_backend_t;
......@@ -61,4 +65,8 @@ struct sam_backend_t {
};
#ifdef __cplusplus
}
#endif
#endif
......@@ -17,6 +17,10 @@
#ifndef __SAM_SELFTEST_H__
#define __SAM_SELFTEST_H__
#ifdef __cplusplus
extern "C" {
#endif
// --------------------------------------------------------------------------
/// @brief Used to add a visual seperator between tests.
......@@ -26,4 +30,8 @@ sam_selftest_introduce (
const char *name);
#ifdef __cplusplus
}
#endif
#endif
......@@ -18,6 +18,10 @@
#ifndef __SAM_BE_STAT_H__
#define __SAM_BE_STAT_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct sam_stat_t sam_stat_t;
typedef struct sam_stat_handle_t sam_stat_handle_t;
......@@ -88,5 +92,8 @@ sam_stat_str_ (
#endif
#ifdef __cplusplus
}
#endif
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment