diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f3205f67..8a1aa375 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -166,7 +166,7 @@ if(BUILD_ICONV) endif(BUILD_ICONV) if(BUILD_BUILTIN_CONFIG) - set(optional_sources ${optional_sources} conf_cookie.c) + set(optional_sources ${optional_sources} conf_cookie.cc) endif(BUILD_BUILTIN_CONFIG) add_executable(conky ${conky_sources} ${optional_sources}) diff --git a/src/conf_cookie.c b/src/conf_cookie.cc similarity index 92% rename from src/conf_cookie.c rename to src/conf_cookie.cc index 6dc9e3ff..14e40cfe 100644 --- a/src/conf_cookie.c +++ b/src/conf_cookie.cc @@ -61,14 +61,13 @@ conf_read(void *cookie, char *buf, COOKIE_LEN_T size) #endif /* defined(HAVE_FOPENCOOKIE) || defined(HAVE_FUNOPEN) */ #if defined(HAVE_FOPENCOOKIE) -static cookie_io_functions_t conf_cookie = { - .read = &conf_read, - .write = NULL, - .seek = NULL, - .close = NULL, -}; +static cookie_io_functions_t conf_cookie; FILE *conf_cookie_open(void) { + conf_cookie.read = &conf_read; + conf_cookie.write = NULL; + conf_cookie.seek = NULL; + conf_cookie.close = NULL; return fopencookie(NULL, "r", conf_cookie); } #elif defined(HAVE_FUNOPEN) diff --git a/src/conf_cookie.h b/src/conf_cookie.h index b58606fd..5458b465 100644 --- a/src/conf_cookie.h +++ b/src/conf_cookie.h @@ -3,14 +3,6 @@ #ifndef _CONF_COOKIE_H #define _CONF_COOKIE_H -#ifdef __cplusplus -extern "C" { -#endif - FILE *conf_cookie_open(void); -#ifdef __cplusplus -} -#endif - #endif /* _CONF_COOKIE_H */