diff --git a/include/ucore/backtrace.h b/include/ucore/backtrace.h index 0110165..d1c43d5 100644 --- a/include/ucore/backtrace.h +++ b/include/ucore/backtrace.h @@ -1,9 +1,12 @@ #ifndef UC_BACKTRACE_H_ #define UC_BACKTRACE_H_ - -#define UC_BACTRACE_STDERR uc_backtrace_fd(2) #include +#ifdef __cplusplus +extern "C" { +#endif + +#define UC_BACTRACE_STDERR uc_backtrace_fd(2) /** * 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); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/ucore/clock.h b/include/ucore/clock.h index fce2c82..b64c4a9 100644 --- a/include/ucore/clock.h +++ b/include/ucore/clock.h @@ -4,6 +4,9 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif /** * An abstract clock. @@ -110,5 +113,9 @@ void uc_settable_clock_set_tv(struct UCoreSettableClock *uclock, void uc_settable_clock_set(struct UCoreSettableClock *uclock, time_t secs, suseconds_t usecs); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/ucore/iomux.h b/include/ucore/iomux.h index 774b6d2..7f8c2f7 100644 --- a/include/ucore/iomux.h +++ b/include/ucore/iomux.h @@ -3,6 +3,11 @@ #include "timers.h" +#ifdef __cplusplus +extern "C" { +#endif + + #define MUX_EV_READ (1U << 0x00) #define MUX_EV_WRITE (1U << 0x01) //#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); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/ucore/mersenne_twister.h b/include/ucore/mersenne_twister.h index 1ff4e6f..f3fb166 100644 --- a/include/ucore/mersenne_twister.h +++ b/include/ucore/mersenne_twister.h @@ -1,6 +1,9 @@ #ifndef UCORE_MERSENNE_TWISTER_H #define UCORE_MERSENNE_TWISTER_H +#ifdef __cplusplus +extern "C" { +#endif /** Context used for the PRNG*/ #define MT_RAND_N 624 @@ -23,5 +26,9 @@ void mtsrand(int seed, MTRand *r); */ unsigned int mtrand(MTRand *r); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/ucore/read_file.h b/include/ucore/read_file.h index e86cc9e..173adc8 100644 --- a/include/ucore/read_file.h +++ b/include/ucore/read_file.h @@ -3,6 +3,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** Read the content of a file. * 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 @@ -17,4 +21,8 @@ char * uc_read_file(const char *file_name, size_t *length, size_t max); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/ucore/timers.h b/include/ucore/timers.h index 19c9744..f4769e3 100644 --- a/include/ucore/timers.h +++ b/include/ucore/timers.h @@ -6,6 +6,9 @@ #include #include "rbtree.h" +#ifdef __cplusplus +extern "C" { +#endif struct UCTimer; struct UCTimers; @@ -140,4 +143,8 @@ int uc_timers_run(struct UCTimers *timers); //uc_timers_destroy(struct UCTimers *timers) is currently missing.. +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/ucore/version.h b/include/ucore/version.h index e33a37f..9f9d0b2 100644 --- a/include/ucore/version.h +++ b/include/ucore/version.h @@ -30,6 +30,9 @@ * * @endhtmlonly */ +#ifdef __cplusplus +extern "C" { +#endif /* Major version of the ucore library*/ extern const int ucore_version_major; @@ -46,5 +49,10 @@ extern const char ucore_version_str[]; /** Hostname where the library was built */ extern const char ucore_build_host[]; + +#ifdef __cplusplus +} +#endif + #endif