From 8bf97bf1c57172beab2fe0f6ebd0eb0b63f639e9 Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Wed, 2 Feb 2000 20:19:59 +0000 Subject: [PATCH] Solved compile problems for g++ programs linked to libsensors git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@722 7894878c-1315-0410-8ee3-d5d059ff63e0 --- TODO | 1 + lib/error.h | 8 ++++++++ lib/sensors.h | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/TODO b/TODO index cfcdab62..536ddc8a 100644 --- a/TODO +++ b/TODO @@ -8,6 +8,7 @@ I2C CODE CHANGES KERNEL MODULES ============== +* Add string function in sensors.o * ALL: cleanup_module is void; check also that cleaning up is done properly, now we know that the module will be unloaded whatever we do. diff --git a/lib/error.h b/lib/error.h index af6857a6..afe77059 100644 --- a/lib/error.h +++ b/lib/error.h @@ -29,6 +29,11 @@ #define SENSORS_ERR_BUS_NAME 7 /* Can't parse bus name */ #define SENSORS_ERR_PARSE 8 /* General parse error */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + /* This function returns a pointer to a string which describes the error. errnum may be negative (the corresponding positive error is returned). You may not modify the result! */ @@ -46,5 +51,8 @@ extern void (*sensors_parse_error) (const char *err, int lineno); the program). Never let it return! */ extern void (*sensors_fatal_error) (const char *proc, const char *err); +#ifdef __cplusplus +} +#endif /* __cplusplus */ #endif /* def LIB_SENSORS_ERROR_H */ diff --git a/lib/sensors.h b/lib/sensors.h index 512e55a1..811e84fa 100644 --- a/lib/sensors.h +++ b/lib/sensors.h @@ -30,6 +30,10 @@ #define SENSORS_CHIP_NAME_BUS_ANY_I2C -3 #define SENSORS_CHIP_NAME_ADDR_ANY -1 +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + /* A chip name is encoded is in this structure */ typedef struct sensors_chip_name { char *prefix; @@ -137,4 +141,8 @@ typedef struct sensors_feature_data { extern const sensors_feature_data *sensors_get_all_features (sensors_chip_name name, int *nr1,int *nr2); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #endif /* def LIB_SENSORS_ERROR_H */