Add "c++ protection" to (hopefully) all of our internal headers
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 21 Sep 2010 12:21:12 +0000 (15:21 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 21 Sep 2010 12:21:12 +0000 (15:21 +0300)
14 files changed:
build/rpmbuild_internal.h
build/rpmbuild_misc.h
lib/backend/dbi.h
lib/rpmchroot.h
lib/rpmfi_internal.h
lib/rpmfs.h
lib/rpmliblua.h
lib/rpmlock.h
lib/rpmscript.h
lib/rpmte_internal.h
lib/rpmts_internal.h
rpmio/base64.h
rpmio/rpmhook.h
rpmio/rpmlua.h

index c681381..24a68cf 100644 (file)
@@ -79,6 +79,10 @@ typedef enum rpmParseState_e {
 #define STRIP_TRAILINGSPACE (1 << 0)
 #define STRIP_COMMENTS      (1 << 1)
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** \ingroup rpmbuild
  * Create and initialize rpmSpec structure.
  * @return spec                spec file control structure
@@ -303,4 +307,8 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating);
 RPM_GNUC_INTERNAL
 rpmRC packageSources(rpmSpec spec, char **cookie);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RPMBUILD_INTERNAL_H */
index 0d2dcd2..525af36 100644 (file)
@@ -5,6 +5,10 @@
 #include <rpm/rpmtypes.h>
 #include <rpm/rpmds.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** \ingroup rpmbuild
  * Destroy uid/gid caches.
  */
@@ -106,4 +110,8 @@ int addReqProv(Header h, rpmTag tagN,
 RPM_GNUC_INTERNAL
 int rpmlibNeedsFeature(Header h, const char * feature, const char * featureEVR);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RPMBUILD_MISC_H */
index f384f19..dd1ada6 100644 (file)
@@ -69,6 +69,10 @@ struct _dbiIndex {
     DB * dbi_db;               /*!< Berkeley DB * handle */
 };
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** \ingroup dbi
  * Return new configured index database handle instance.
  * @param rpmdb                rpm database
@@ -221,4 +225,8 @@ int dbiByteSwapped(dbiIndex dbi);
 RPM_GNUC_INTERNAL
 dbiIndexType dbiType(dbiIndex dbi);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _DBI_H */
index 1c3f5b6..ba7dea5 100644 (file)
@@ -3,6 +3,10 @@
 
 #include <rpm/rpmutil.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** \ingroup rpmchroot
  * Set or clear process-wide chroot directory.
  * Calling this while chrooted is an error.
@@ -33,4 +37,9 @@ int rpmChrootOut(void);
 /* RPM_GNUC_INTERNAL */
 int rpmChrootDone(void);
 
+#ifdef __cplusplus
+}
+#endif
+
+
 #endif /* _RPMCHROOT_H */
index 54e3dba..c89dea1 100644 (file)
@@ -79,6 +79,10 @@ struct rpmfi_s {
     int nrefs;         /*!< Reference count. */
 };
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 RPM_GNUC_INTERNAL
 int rpmfiDIIndex(rpmfi fi, int dx);
 
@@ -159,5 +163,10 @@ void rpmfiFpLookup(rpmfi fi, fingerPrintCache fpc);
 
 /* XXX can't be internal as build code needs this */
 FSM_t rpmfiFSM(rpmfi fi);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RPMFI_INTERNAL_H */
 
index d2c66ad..129bc65 100644 (file)
@@ -18,6 +18,10 @@ struct sharedFileInfo_s {
     int otherFileNum;
 };
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 RPM_GNUC_INTERNAL
 rpmfs rpmfsNew(Header h, rpmElementType type);
 
@@ -52,4 +56,8 @@ rpmFileAction rpmfsGetAction(rpmfs fs, unsigned int ix);
 /* XXX this should be internal too but build code needs for now */
 void rpmfsSetAction(rpmfs fs, unsigned int ix, rpmFileAction action);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RPMFS_H */
index cc15ae9..730503f 100644 (file)
@@ -1,10 +1,18 @@
 #ifndef _RPMLIBLUA_H
 #define _RPMLIBLUA_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Initialize Lua subsystem & register all our extensions */
 void rpmLuaInit(void);
 
 /* Shutdown Lua subsystem */
 void rpmLuaFree(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RPMLIBLUA_H */
index 96f6de2..aa85451 100644 (file)
@@ -5,10 +5,18 @@
 
 typedef struct rpmlock_s * rpmlock;
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 RPM_GNUC_INTERNAL
 rpmlock rpmlockAcquire(const char *lock_path, const char *descr);
 
 RPM_GNUC_INTERNAL
 rpmlock rpmlockFree(rpmlock lock);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index c0a78f0..9c340df 100644 (file)
@@ -22,6 +22,10 @@ struct rpmScript_s {
     rpmscriptFlags flags;      /* flags to control operation */
 };
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 RPM_GNUC_INTERNAL
 rpmScript rpmScriptFromTag(Header h, rpmTag scriptTag);
 
@@ -32,4 +36,7 @@ RPM_GNUC_INTERNAL
 rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2, FD_t scriptFd,
                    ARGV_const_t prefixes, int warn_only, int selinux);
 
+#ifdef __cplusplus
+}
+#endif
 #endif /* _RPMSCRIPT_H */
index 4f1a9f9..8a8df2a 100644 (file)
@@ -21,6 +21,10 @@ typedef enum pkgGoal_e {
  */
 typedef struct tsortInfo_s *           tsortInfo;
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** \ingroup rpmte
  * Create a transaction element.
  * @param ts           transaction set
@@ -142,5 +146,9 @@ int rpmteAddToFirstInCollectionRemove(rpmte te, const char * collname);
 RPM_GNUC_INTERNAL
 rpmRC rpmteSetupCollectionPlugins(rpmte te);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RPMTE_INTERNAL_H */
 
index 5d7fbd7..7ed6eb6 100644 (file)
@@ -67,6 +67,10 @@ struct rpmts_s {
     int nrefs;                 /*!< Reference count. */
 };
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 RPM_GNUC_INTERNAL
 tsMembers rpmtsMembers(rpmts ts);
 
@@ -76,4 +80,8 @@ int rpmtsSolve(rpmts ts, rpmds key);
 
 RPM_GNUC_INTERNAL
 rpmlock rpmtsAcquireLock(rpmts ts);
+
+#ifdef __cplusplus
+}
+#endif
 #endif /* _RPMTS_INTERNAL_H */
index 79ae0b6..d572856 100644 (file)
@@ -3,6 +3,10 @@
 
 #include <sys/types.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* returns malloced base64 encoded string
  * lines are split with \n characters to be nearest lower multiple of linelen
  * if linelen/4 == 0 lines are not split
@@ -27,3 +31,7 @@ int b64decode(const char *in, void **out, size_t *outlen);
  * returns NULL on failures
  */
 char *b64crc(const unsigned char *data, size_t len);
+
+#ifdef __cplusplus
+}
+#endif
index c049c48..52f5634 100644 (file)
@@ -16,6 +16,10 @@ typedef struct rpmhookArgs_s {
 
 typedef int (*rpmhookFunc) (rpmhookArgs args, void *data);
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 rpmhookArgs rpmhookArgsNew(int argc);
 rpmhookArgs rpmhookArgsFree(rpmhookArgs args);
 
@@ -26,4 +30,8 @@ void rpmhookUnregisterAll(const char *name);
 void rpmhookCall(const char *name, const char *argt, ...);
 void rpmhookCallArgs(const char *name, rpmhookArgs args);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 49f5bf6..c8a310e 100644 (file)
@@ -42,6 +42,10 @@ struct rpmluav_s {
 typedef struct rpmlua_s * rpmlua;
 typedef struct rpmluav_s * rpmluav;
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 rpmlua rpmluaNew(void);
 rpmlua rpmluaFree(rpmlua lua);
 rpmlua rpmluaGetGlobalState(void);
@@ -82,4 +86,8 @@ double rpmluavGetValueNum(rpmluav var);
 int rpmluavKeyIsNum(rpmluav var);
 int rpmluavValueIsNum(rpmluav var);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* RPMLUA_H */