From e41e9306c171b1926b918a212260e002cbb5fcc0 Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Sat, 5 Feb 2011 01:07:47 +0100 Subject: [PATCH] Small change to exporting functions not found in include files on some platforms. Wrap it as one extern "C" block just like its done on most platforms in the proper include files. --- bacula/src/baconfig.h | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/bacula/src/baconfig.h b/bacula/src/baconfig.h index 6d2cc473c9..cc258f4404 100644 --- a/bacula/src/baconfig.h +++ b/bacula/src/baconfig.h @@ -540,10 +540,16 @@ extern int thr_setconcurrency(int); #endif -#if defined(HAVE_DARWIN_OS) || defined(HAVE_OSF1_OS) +#ifdef HAVE_DARWIN_OS /* Apparently someone forgot to wrap getdomainname as a C function */ -extern "C" int getdomainname(char *name, int len); -#endif +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ +int getdomainname(char *name, int len); +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* HAVE_DARWIN_OS */ @@ -582,16 +588,28 @@ extern int h_errno; * the problem is no system headers declares the prototypes for these functions * this is done below */ -extern "C" int getdomainname(char *name, int namelen); -extern "C" int setdomainname(char *name, int namelen); +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ +int getdomainname(char *name, int namelen); +int setdomainname(char *name, int namelen); +#ifdef __cplusplus +} +#endif /* __cplusplus */ #endif /* HAVE_HPUX_OS */ #ifdef HAVE_OSF1_OS -extern "C" int fchdir(int filedes); -extern "C" long gethostid(void); -extern "C" int mknod(const char *path, int mode, dev_t device ); -#endif +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ +int fchdir(int filedes); +long gethostid(void); +int getdomainname(char *name, int len); +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* HAVE_OSF1_OS */ /** Disabled because it breaks internationalisation... -- 2.39.5