summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-03-21 15:54:15 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2014-03-21 15:54:15 +0100
commit63ff42089863cda53aee240ea0124106e8b4d983 (patch)
tree4f4ff556d5f37f3414804d0394ac9568c7bcc9ac
parenta1b6a4e7c5f5a859d27e00c2753b7f7b7e9ae14d (diff)
enable fvisibility=hidden for our private library
While it is a huge undertaking to enable it for our public libraries as basically everything we exported so far could be seen as public interface our private library is new and under our full control, so we can do whatever we like with it. The benefits are not that big in return of course, but it reduces the size a bit, so thats great nontheless. Git-Dch: ignore
-rw-r--r--apt-pkg/contrib/macros.h4
-rw-r--r--apt-private/acqprogress.h9
-rw-r--r--apt-private/makefile1
-rw-r--r--apt-private/private-cachefile.h7
-rw-r--r--apt-private/private-cmndline.h3
-rw-r--r--apt-private/private-download.h6
-rw-r--r--apt-private/private-install.h8
-rw-r--r--apt-private/private-list.h4
-rw-r--r--apt-private/private-main.h4
-rw-r--r--apt-private/private-moo.h2
-rw-r--r--apt-private/private-output.h21
-rw-r--r--apt-private/private-search.h4
-rw-r--r--apt-private/private-show.h4
-rw-r--r--apt-private/private-sources.h4
-rw-r--r--apt-private/private-update.h4
-rw-r--r--apt-private/private-upgrade.h6
-rw-r--r--apt-private/private-utils.h8
17 files changed, 65 insertions, 34 deletions
diff --git a/apt-pkg/contrib/macros.h b/apt-pkg/contrib/macros.h
index d97053553..2d6448e5e 100644
--- a/apt-pkg/contrib/macros.h
+++ b/apt-pkg/contrib/macros.h
@@ -94,8 +94,12 @@
#if APT_GCC_VERSION >= 0x0400
#define APT_SENTINEL __attribute__((sentinel))
+ #define APT_PUBLIC __attribute__ ((visibility ("default")))
+ #define APT_HIDDEN __attribute__ ((visibility ("hidden")))
#else
#define APT_SENTINEL
+ #define APT_PUBLIC
+ #define APT_HIDDEN
#endif
// cold functions are unlikely() to be called
diff --git a/apt-private/acqprogress.h b/apt-private/acqprogress.h
index e12dafe50..71a10d78a 100644
--- a/apt-private/acqprogress.h
+++ b/apt-private/acqprogress.h
@@ -10,18 +10,19 @@
#define ACQPROGRESS_H
#include <apt-pkg/acquire.h>
+#include <apt-pkg/macros.h>
#include <string>
-class AcqTextStatus : public pkgAcquireStatus
+class APT_PUBLIC AcqTextStatus : public pkgAcquireStatus
{
unsigned int &ScreenWidth;
char BlankLine[1024];
unsigned long ID;
unsigned long Quiet;
-
+
public:
-
+
virtual bool MediaChange(std::string Media,std::string Drive);
virtual void IMSHit(pkgAcquire::ItemDesc &Itm);
virtual void Fetch(pkgAcquire::ItemDesc &Itm);
@@ -29,7 +30,7 @@ class AcqTextStatus : public pkgAcquireStatus
virtual void Fail(pkgAcquire::ItemDesc &Itm);
virtual void Start();
virtual void Stop();
-
+
bool Pulse(pkgAcquire *Owner);
AcqTextStatus(unsigned int &ScreenWidth,unsigned int const Quiet);
diff --git a/apt-private/makefile b/apt-private/makefile
index 728890b9b..09736c6d3 100644
--- a/apt-private/makefile
+++ b/apt-private/makefile
@@ -16,6 +16,7 @@ LIBRARY=apt-private
MAJOR=0.0
MINOR=0
SLIBS=$(PTHREADLIB) -lapt-pkg
+CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
PRIVATES=list install download output cachefile cacheset update upgrade cmndline moo search show main utils sources
SOURCE += $(foreach private, $(PRIVATES), private-$(private).cc)
diff --git a/apt-private/private-cachefile.h b/apt-private/private-cachefile.h
index 67c5e8cdc..dce7e0a3a 100644
--- a/apt-private/private-cachefile.h
+++ b/apt-private/private-cachefile.h
@@ -5,16 +5,17 @@
#include <apt-pkg/progress.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/macros.h>
// class CacheFile - Cover class for some dependency cache functions /*{{{*/
// ---------------------------------------------------------------------
/* */
-class CacheFile : public pkgCacheFile
+class APT_PUBLIC CacheFile : public pkgCacheFile
{
static pkgCache *SortCache;
- static int NameComp(const void *a,const void *b) APT_PURE;
-
+ APT_HIDDEN static int NameComp(const void *a,const void *b) APT_PURE;
+
public:
pkgCache::Package **List;
diff --git a/apt-private/private-cmndline.h b/apt-private/private-cmndline.h
index 76045ffe7..d0af16782 100644
--- a/apt-private/private-cmndline.h
+++ b/apt-private/private-cmndline.h
@@ -2,9 +2,10 @@
#define APT_PRIVATE_CMNDLINE_H
#include <apt-pkg/cmndline.h>
+#include <apt-pkg/macros.h>
#include <vector>
-std::vector<CommandLine::Args> getCommandArgs(char const * const Program, char const * const Cmd);
+APT_PUBLIC std::vector<CommandLine::Args> getCommandArgs(char const * const Program, char const * const Cmd);
#endif
diff --git a/apt-private/private-download.h b/apt-private/private-download.h
index 1447845ed..a108aa531 100644
--- a/apt-private/private-download.h
+++ b/apt-private/private-download.h
@@ -1,9 +1,11 @@
#ifndef APT_PRIVATE_DOWNLOAD_H
#define APT_PRIVATE_DOWNLOAD_H
+#include <apt-pkg/macros.h>
+
class pkgAcquire;
-bool CheckAuth(pkgAcquire& Fetcher, bool const PromptUser);
-bool AcquireRun(pkgAcquire &Fetcher, int const PulseInterval, bool * const Failure, bool * const TransientNetworkFailure);
+APT_PUBLIC bool CheckAuth(pkgAcquire& Fetcher, bool const PromptUser);
+APT_PUBLIC bool AcquireRun(pkgAcquire &Fetcher, int const PulseInterval, bool * const Failure, bool * const TransientNetworkFailure);
#endif
diff --git a/apt-private/private-install.h b/apt-private/private-install.h
index 79769d470..5e18560c5 100644
--- a/apt-private/private-install.h
+++ b/apt-private/private-install.h
@@ -9,6 +9,9 @@
#include <apt-pkg/cacheset.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/algorithms.h>
+#include <apt-pkg/macros.h>
+
+#include <apt-private/private-output.h>
#include <stddef.h>
#include <iosfwd>
@@ -17,7 +20,6 @@
#include <string>
#include <utility>
-#include "private-output.h"
#include <apti18n.h>
@@ -26,13 +28,13 @@ class CommandLine;
#define RAMFS_MAGIC 0x858458f6
-bool DoInstall(CommandLine &Cmd);
+APT_PUBLIC bool DoInstall(CommandLine &Cmd);
bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache,
std::map<unsigned short, APT::VersionSet> &verset);
bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache);
-bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
+APT_PUBLIC bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
bool Safety = true);
diff --git a/apt-private/private-list.h b/apt-private/private-list.h
index 749744dd1..461f527cb 100644
--- a/apt-private/private-list.h
+++ b/apt-private/private-list.h
@@ -1,9 +1,11 @@
#ifndef APT_PRIVATE_LIST_H
#define APT_PRIVATE_LIST_H
+#include <apt-pkg/macros.h>
+
class CommandLine;
-bool List(CommandLine &Cmd);
+APT_PUBLIC bool List(CommandLine &Cmd);
#endif
diff --git a/apt-private/private-main.h b/apt-private/private-main.h
index 257c51a0b..23d4aca68 100644
--- a/apt-private/private-main.h
+++ b/apt-private/private-main.h
@@ -1,8 +1,10 @@
#ifndef APT_PRIVATE_MAIN_H
#define APT_PRIVATE_MAIN_H
+#include <apt-pkg/macros.h>
+
class CommandLine;
-void CheckSimulateMode(CommandLine &CmdL);
+APT_PUBLIC void CheckSimulateMode(CommandLine &CmdL);
#endif
diff --git a/apt-private/private-moo.h b/apt-private/private-moo.h
index 7bfc5c1fc..b8e1cfed6 100644
--- a/apt-private/private-moo.h
+++ b/apt-private/private-moo.h
@@ -3,7 +3,7 @@
class CommandLine;
-bool DoMoo(CommandLine &CmdL);
+APT_PUBLIC bool DoMoo(CommandLine &CmdL);
bool DoMoo1(CommandLine &CmdL);
bool DoMoo2(CommandLine &CmdL);
bool DoMoo3(CommandLine &CmdL);
diff --git a/apt-private/private-output.h b/apt-private/private-output.h
index 81643f90a..9633d0c37 100644
--- a/apt-private/private-output.h
+++ b/apt-private/private-output.h
@@ -2,6 +2,7 @@
#define APT_PRIVATE_OUTPUT_H
#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/macros.h>
#include <fstream>
#include <string>
@@ -13,22 +14,24 @@ class pkgDepCache;
class pkgRecords;
-extern std::ostream c0out;
-extern std::ostream c1out;
-extern std::ostream c2out;
-extern std::ofstream devnull;
-extern unsigned int ScreenWidth;
+APT_PUBLIC extern std::ostream c0out;
+APT_PUBLIC extern std::ostream c1out;
+APT_PUBLIC extern std::ostream c2out;
+APT_PUBLIC extern std::ofstream devnull;
+APT_PUBLIC extern unsigned int ScreenWidth;
-bool InitOutput();
-void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records,
+APT_PUBLIC bool InitOutput();
+
+void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records,
pkgCache::VerIterator V, std::ostream &out,
bool include_summary=true);
// helper to describe global state
-bool ShowList(std::ostream &out, std::string Title, std::string List,
+APT_PUBLIC void ShowBroken(std::ostream &out,CacheFile &Cache,bool Now);
+
+APT_PUBLIC bool ShowList(std::ostream &out, std::string Title, std::string List,
std::string VersionsList);
-void ShowBroken(std::ostream &out,CacheFile &Cache,bool Now);
void ShowNew(std::ostream &out,CacheFile &Cache);
void ShowDel(std::ostream &out,CacheFile &Cache);
void ShowKept(std::ostream &out,CacheFile &Cache);
diff --git a/apt-private/private-search.h b/apt-private/private-search.h
index 539915f1f..d4786233a 100644
--- a/apt-private/private-search.h
+++ b/apt-private/private-search.h
@@ -1,9 +1,11 @@
#ifndef APT_PRIVATE_SEARCH_H
#define APT_PRIVATE_SEARCH_H
+#include <apt-pkg/macros.h>
+
class CommandLine;
-bool FullTextSearch(CommandLine &CmdL);
+APT_PUBLIC bool FullTextSearch(CommandLine &CmdL);
#endif
diff --git a/apt-private/private-show.h b/apt-private/private-show.h
index a15367e28..359aeeb28 100644
--- a/apt-private/private-show.h
+++ b/apt-private/private-show.h
@@ -1,12 +1,14 @@
#ifndef APT_PRIVATE_SHOW_H
#define APT_PRIVATE_SHOW_H
+#include <apt-pkg/macros.h>
+
class CommandLine;
namespace APT {
namespace Cmd {
- bool ShowPackage(CommandLine &CmdL);
+ APT_PUBLIC bool ShowPackage(CommandLine &CmdL);
}
}
#endif
diff --git a/apt-private/private-sources.h b/apt-private/private-sources.h
index 4c58af180..0c421902e 100644
--- a/apt-private/private-sources.h
+++ b/apt-private/private-sources.h
@@ -1,8 +1,10 @@
#ifndef APT_PRIVATE_SOURCES_H
#define APT_PRIVATE_SOURCES_H
+#include <apt-pkg/macros.h>
+
class CommandLine;
-bool EditSources(CommandLine &CmdL);
+APT_PUBLIC bool EditSources(CommandLine &CmdL);
#endif
diff --git a/apt-private/private-update.h b/apt-private/private-update.h
index d3d0b7af9..e584f70cf 100644
--- a/apt-private/private-update.h
+++ b/apt-private/private-update.h
@@ -1,8 +1,10 @@
#ifndef APT_PRIVATE_UPDATE_H
#define APT_PRIVATE_UPDATE_H
+#include <apt-pkg/macros.h>
+
class CommandLine;
-bool DoUpdate(CommandLine &CmdL);
+APT_PUBLIC bool DoUpdate(CommandLine &CmdL);
#endif
diff --git a/apt-private/private-upgrade.h b/apt-private/private-upgrade.h
index 64c4c0874..16bb93c9b 100644
--- a/apt-private/private-upgrade.h
+++ b/apt-private/private-upgrade.h
@@ -1,10 +1,12 @@
#ifndef APTPRIVATE_PRIVATE_UPGRADE_H
#define APTPRIVATE_PRIVATE_UPGRADE_H
+#include <apt-pkg/macros.h>
+
class CommandLine;
-bool DoDistUpgrade(CommandLine &CmdL);
-bool DoUpgrade(CommandLine &CmdL);
+APT_PUBLIC bool DoDistUpgrade(CommandLine &CmdL);
+APT_PUBLIC bool DoUpgrade(CommandLine &CmdL);
bool DoUpgradeNoNewPackages(CommandLine &CmdL);
bool DoUpgradeWithAllowNewPackages(CommandLine &CmdL);
diff --git a/apt-private/private-utils.h b/apt-private/private-utils.h
index 4bb535e86..432699787 100644
--- a/apt-private/private-utils.h
+++ b/apt-private/private-utils.h
@@ -1,9 +1,11 @@
#ifndef APT_PRIVATE_UTILS_H
#define APT_PRIVATE_UTILS_H
-#include<string>
+#include <apt-pkg/macros.h>
-void DisplayFileInPager(std::string filename);
-void EditFileInSensibleEditor(std::string filename);
+#include <string>
+
+APT_PUBLIC void DisplayFileInPager(std::string filename);
+APT_PUBLIC void EditFileInSensibleEditor(std::string filename);
#endif