[tyndur-devel] [PATCH 3/4] libc: Mehr extern "C"
Kevin Wolf ·
* libc: extern "C" fuer noch ein paar Headerdateien mehr Signed-off-by: Kevin Wolf <kevin at tyndur.org> --- src/modules/include/dirent.h | 9 +++++++++ src/modules/include/libgen.h | 8 ++++++++ src/modules/include/sys/stat.h | 9 +++++++++ 3 files changed, 26 insertions(+), 0 deletions(-) diff --git a/src/modules/include/dirent.h b/src/modules/include/dirent.h index e84c15a..2cdf69a 100644 --- a/src/modules/include/dirent.h +++ b/src/modules/include/dirent.h @@ -37,6 +37,11 @@ struct dirent { typedef io_resource_t DIR; + +#ifdef __cplusplus +extern "C" { +#endif + DIR* opendir(const char * name); int closedir(DIR * dir); @@ -45,5 +50,9 @@ long telldir(DIR * dir); void rewinddir(DIR * dir); void seekdir(DIR * dir, long offset); +#ifdef __cplusplus +}; // extern "C" +#endif + #endif diff --git a/src/modules/include/libgen.h b/src/modules/include/libgen.h index 5b5f58c..31ce967 100644 --- a/src/modules/include/libgen.h +++ b/src/modules/include/libgen.h @@ -29,6 +29,10 @@ #ifndef _LIBGEN_H_ #define _LIBGEN_H_ +#ifdef __cplusplus +extern "C" { +#endif + /** * Trennt den Dateinamen aus einem Pfad heraus. Wenn path ein Nullpointer ist, * wird "." zurueckgegeben. Der Rueckgabestring befindet sich in einem @@ -43,4 +47,8 @@ char* basename(char* path); */ char* dirname(char* path); +#ifdef __cplusplus +}; // extern "C" +#endif + #endif diff --git a/src/modules/include/sys/stat.h b/src/modules/include/sys/stat.h index 5e7cfcb..62fee46 100644 --- a/src/modules/include/sys/stat.h +++ b/src/modules/include/sys/stat.h @@ -111,6 +111,11 @@ struct stat { blkcnt_t st_blocks; /// Anzahl der Blocks }; + +#ifdef __cplusplus +extern "C" { +#endif + /// Modus einer Datei aendern int chmod(const char* filename, mode_t mode); @@ -138,4 +143,8 @@ int mknod(const char* filename, mode_t mode, dev_t device); /// Modus fuer neue Dateien festlegen mode_t umask(mode_t mode); +#ifdef __cplusplus +}; // extern "C" +#endif + #endif //ifndef _SYS_STAT_H_ -- 1.6.0.2
Antworten
- [tyndur-devel] [PATCH 3/4] libc: Mehr extern "C" · Antoine Kaufmann