add C++ guards

This commit is contained in:
Nils O. Selåsdal
2013-06-19 18:48:45 +02:00
parent 6268e6ac8e
commit b4f9ecafe2
7 changed files with 55 additions and 2 deletions
+9 -2
View File
@@ -1,9 +1,12 @@
#ifndef UC_BACKTRACE_H_ #ifndef UC_BACKTRACE_H_
#define UC_BACKTRACE_H_ #define UC_BACKTRACE_H_
#define UC_BACTRACE_STDERR uc_backtrace_fd(2)
#include <stddef.h> #include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
#define UC_BACTRACE_STDERR uc_backtrace_fd(2)
/** /**
* Print a stacktrace to the given file descriptor. * Print a stacktrace to the given file descriptor.
* *
@@ -21,4 +24,8 @@ void uc_backtrace_fd(int fd);
*/ */
void uc_backtrace_buf(char *buf, size_t len); void uc_backtrace_buf(char *buf, size_t len);
#ifdef __cplusplus
}
#endif
#endif #endif
+7
View File
@@ -4,6 +4,9 @@
#include <sys/time.h> #include <sys/time.h>
#include <time.h> #include <time.h>
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* An abstract clock. * An abstract clock.
@@ -110,5 +113,9 @@ void uc_settable_clock_set_tv(struct UCoreSettableClock *uclock,
void uc_settable_clock_set(struct UCoreSettableClock *uclock, void uc_settable_clock_set(struct UCoreSettableClock *uclock,
time_t secs, suseconds_t usecs); time_t secs, suseconds_t usecs);
#ifdef __cplusplus
}
#endif
#endif #endif
+9
View File
@@ -3,6 +3,11 @@
#include "timers.h" #include "timers.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MUX_EV_READ (1U << 0x00) #define MUX_EV_READ (1U << 0x00)
#define MUX_EV_WRITE (1U << 0x01) #define MUX_EV_WRITE (1U << 0x01)
//#define MUX_EV_EXCEPT (1 << 0x02) //#define MUX_EV_EXCEPT (1 << 0x02)
@@ -100,5 +105,9 @@ int iomux_update_events(struct IOMux *mux, struct IOMuxFD *fd);
*/ */
struct UCTimers *iomux_get_timers(struct IOMux *mux); struct UCTimers *iomux_get_timers(struct IOMux *mux);
#ifdef __cplusplus
}
#endif
#endif #endif
+7
View File
@@ -1,6 +1,9 @@
#ifndef UCORE_MERSENNE_TWISTER_H #ifndef UCORE_MERSENNE_TWISTER_H
#define UCORE_MERSENNE_TWISTER_H #define UCORE_MERSENNE_TWISTER_H
#ifdef __cplusplus
extern "C" {
#endif
/** Context used for the PRNG*/ /** Context used for the PRNG*/
#define MT_RAND_N 624 #define MT_RAND_N 624
@@ -23,5 +26,9 @@ void mtsrand(int seed, MTRand *r);
*/ */
unsigned int mtrand(MTRand *r); unsigned int mtrand(MTRand *r);
#ifdef __cplusplus
}
#endif
#endif #endif
+8
View File
@@ -3,6 +3,10 @@
#include <stddef.h> #include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/** Read the content of a file. /** Read the content of a file.
* The returned char* is malloced memory and must be freed by the caller. * The returned char* is malloced memory and must be freed by the caller.
* The content is terminated by a nul byte, regardless of whether the content * The content is terminated by a nul byte, regardless of whether the content
@@ -17,4 +21,8 @@
char * char *
uc_read_file(const char *file_name, size_t *length, size_t max); uc_read_file(const char *file_name, size_t *length, size_t max);
#ifdef __cplusplus
}
#endif
#endif #endif
+7
View File
@@ -6,6 +6,9 @@
#include <sys/time.h> #include <sys/time.h>
#include "rbtree.h" #include "rbtree.h"
#ifdef __cplusplus
extern "C" {
#endif
struct UCTimer; struct UCTimer;
struct UCTimers; struct UCTimers;
@@ -140,4 +143,8 @@ int uc_timers_run(struct UCTimers *timers);
//uc_timers_destroy(struct UCTimers *timers) is currently missing.. //uc_timers_destroy(struct UCTimers *timers) is currently missing..
#ifdef __cplusplus
}
#endif
#endif #endif
+8
View File
@@ -30,6 +30,9 @@
* </pre> * </pre>
* @endhtmlonly * @endhtmlonly
*/ */
#ifdef __cplusplus
extern "C" {
#endif
/* Major version of the ucore library*/ /* Major version of the ucore library*/
extern const int ucore_version_major; extern const int ucore_version_major;
@@ -46,5 +49,10 @@ extern const char ucore_version_str[];
/** Hostname where the library was built /** Hostname where the library was built
*/ */
extern const char ucore_build_host[]; extern const char ucore_build_host[];
#ifdef __cplusplus
}
#endif
#endif #endif