aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-28 04:28:13 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-28 04:28:13 +0000
commitf296289c0686ed045842717a97ab88b1eae91db9 (patch)
treeb706940ad0998ebb3a13ca0e832eae3142c7f3cf
parent2fce25cdbfc4e90252977728b955d86b2940c1d6 (diff)
downloadpaludis-f296289c0686ed045842717a97ab88b1eae91db9.tar.gz
paludis-f296289c0686ed045842717a97ab88b1eae91db9.tar.xz
Add visibility support to some of the smaller libraries
-rw-r--r--configure.ac38
-rwxr-xr-xmisc/make_sr.bash12
-rw-r--r--paludis/args/Makefile.am6
-rw-r--r--paludis/args/args_TEST.cc2
-rw-r--r--paludis/args/args_dumper.hh3
-rw-r--r--paludis/args/args_error.cc10
-rw-r--r--paludis/args/args_error.hh36
-rw-r--r--paludis/args/args_group.hh2
-rw-r--r--paludis/args/args_handler.hh4
-rw-r--r--paludis/args/args_option.cc2
-rw-r--r--paludis/args/args_option.hh33
-rw-r--r--paludis/args/args_visitor.cc3
-rw-r--r--paludis/args/args_visitor.hh4
-rw-r--r--paludis/args/bad_argument.hh3
-rw-r--r--paludis/args/bad_value.cc32
-rw-r--r--paludis/args/bad_value.hh53
-rw-r--r--paludis/args/man.hh2
-rw-r--r--paludis/args/missing_value.cc36
-rw-r--r--paludis/args/missing_value.hh55
-rw-r--r--paludis/digests/Makefile.am3
-rw-r--r--paludis/digests/md5.hh2
-rw-r--r--paludis/digests/rmd160.hh2
-rw-r--r--paludis/digests/sha256.hh2
-rw-r--r--paludis/repositories/virtuals/Makefile.am2
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc12
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.hh5
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc12
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.hh5
-rw-r--r--paludis/repositories/virtuals/vr_entry.hh1
-rw-r--r--paludis/selinux/Makefile.am2
-rw-r--r--paludis/selinux/security_context.hh20
-rw-r--r--paludis/tasks/Makefile.am2
-rw-r--r--paludis/tasks/install_task.hh6
-rw-r--r--paludis/tasks/sync_task.hh2
-rw-r--r--paludis/tasks/uninstall_task.hh4
-rw-r--r--paludis/util/Makefile.am.m44
-rw-r--r--paludis/util/attributes.hh.in (renamed from paludis/util/attributes.hh)9
37 files changed, 191 insertions, 240 deletions
diff --git a/configure.ac b/configure.ac
index 1705dcf..9c4d840 100644
--- a/configure.ac
+++ b/configure.ac
@@ -255,6 +255,7 @@ PALUDIS_CXXFLAGS_NO_WOLD_STYLE_CAST=
PALUDIS_CXXFLAGS_NO_WREDUNDANT_DECLS=
PALUDIS_CXXFLAGS_NO_WSHADOW=
PALUDIS_CXXFLAGS_WITHOUT_PEDANTIC=
+PALUDIS_CXXFLAGS_VISIBILITY=
AC_MSG_CHECKING([whether our compiler is iccy])
AC_COMPILE_IFELSE([
#ifndef __ICC
@@ -331,6 +332,42 @@ AC_SUBST([PALUDIS_CXXFLAGS_WITHOUT_PEDANTIC])
AC_SUBST([PALUDIS_CXXFLAGS_NO_WOLD_STYLE_CAST])
AC_SUBST([PALUDIS_CXXFLAGS_NO_WSHADOW])
AC_SUBST([PALUDIS_CXXFLAGS_NO_WREDUNDANT_DECLS])
+
+AC_MSG_CHECKING([whether to enable visibility])
+AC_ARG_ENABLE([visibility],
+ AS_HELP_STRING([--enable-visibility], [Enable visibility (g++-4.1)]),
+ [ENABLE_VISIBILITY=$enableval
+ AC_MSG_RESULT([$enableval])],
+ [AC_COMPILE_IFELSE([
+#ifdef __ICC
+# error nope
+#endif
+#if ! defined(__GNUC__)
+# error nope
+#endif
+#if ! ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__>= 1))
+# error nope
+#endif
+],
+ [ENABLE_VISIBILITY=yes],
+ [ENABLE_VISIBILITY=no])
+ AC_MSG_RESULT([$ENABLE_VISIBILITY])])
+AC_SUBST([ENABLE_VISIBILITY])
+if test "x$ENABLE_VISIBILITY" = "xyes" ; then
+ AC_MSG_CHECKING([for appropriate compiler visibility flags])
+ old_PALUDIS_CXXFLAGS=$PALUDIS_CXXFLAGS
+ PALUDIS_CXXFLAGS=
+ CHECK_CXXFLAG([-fvisibility-inlines-hidden])
+ CHECK_CXXFLAG([-fvisibility=hidden])
+ AC_MSG_RESULT([$PALUDIS_CXXFLAGS])
+ PALUDIS_CXXFLAGS_VISIBILITY=$PALUDIS_CXXFLAGS
+ PALUDIS_CXXFLAGS=$old_PALUDIS_CXXFLAGS
+ PALUDIS_ENABLE_VISIBILITY=1
+else
+ PALUDIS_ENABLE_VISIBILITY=0
+fi
+AC_SUBST([PALUDIS_ENABLE_VISIBILITY])
+AC_SUBST([PALUDIS_CXXFLAGS_VISIBILITY])
dnl }}}
dnl {{{ sandbox
@@ -613,6 +650,7 @@ AC_OUTPUT(
paludis/selinux/Makefile
paludis/tasks/Makefile
paludis/util/Makefile
+ paludis/util/attributes.hh
ruby/Makefile
ruby/demos/Makefile
src/Makefile
diff --git a/misc/make_sr.bash b/misc/make_sr.bash
index 01d692b..381c9fa 100755
--- a/misc/make_sr.bash
+++ b/misc/make_sr.bash
@@ -37,6 +37,7 @@ while read a ; do
a=${a%% *}
want_named_args=
+ want_visible=
want_keys=( )
want_key_types=( )
want_comparison_operators=
@@ -57,6 +58,11 @@ while read a ; do
want_named_args=yes
}
+ visible()
+ {
+ want_visible=yes
+ }
+
doxygen_comment()
{
:
@@ -123,7 +129,11 @@ while read a ; do
}
if [[ "${what_to_make}" == "--header" ]] ; then
- echo "class ${a}"
+ if [[ -z ${want_visible} ]] ; then
+ echo "class ${a}"
+ else
+ echo "class PALUDIS_VISIBLE ${a}"
+ fi
echo "{"
echo " public:"
echo
diff --git a/paludis/args/Makefile.am b/paludis/args/Makefile.am
index 19ed608..184ed7c 100644
--- a/paludis/args/Makefile.am
+++ b/paludis/args/Makefile.am
@@ -1,6 +1,6 @@
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
MAINTAINERCLEANFILES = Makefile.in
-AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@ @PALUDIS_CXXFLAGS_VISIBILITY@
TESTS = \
args_TEST
@@ -15,8 +15,6 @@ paludis_args_include_HEADERS = \
args_option.hh \
bad_argument.hh \
args_visitor.hh \
- bad_value.hh \
- missing_value.hh \
args_dumper.hh \
man.hh
@@ -28,8 +26,6 @@ libpaludisargs_la_SOURCES = $(paludis_args_include_HEADERS) \
args_option.cc \
bad_argument.cc \
args_visitor.cc \
- bad_value.cc \
- missing_value.cc \
args_dumper.cc \
man.cc
diff --git a/paludis/args/args_TEST.cc b/paludis/args/args_TEST.cc
index f2c0a05..56193ae 100644
--- a/paludis/args/args_TEST.cc
+++ b/paludis/args/args_TEST.cc
@@ -18,7 +18,7 @@
*/
#include <paludis/args/args.hh>
-#include <paludis/args/missing_value.hh>
+#include <paludis/args/args_error.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
diff --git a/paludis/args/args_dumper.hh b/paludis/args/args_dumper.hh
index 494ccb2..c53a3b3 100644
--- a/paludis/args/args_dumper.hh
+++ b/paludis/args/args_dumper.hh
@@ -41,7 +41,8 @@ namespace paludis
*
* \ingroup grplibpaludisargs
*/
- class ArgsDumper : public ArgsVisitorTypes::ConstVisitor
+ class PALUDIS_VISIBLE ArgsDumper :
+ public ArgsVisitorTypes::ConstVisitor
{
private:
std::ostream & _os;
diff --git a/paludis/args/args_error.cc b/paludis/args/args_error.cc
index b3f8d7e..36f9ee4 100644
--- a/paludis/args/args_error.cc
+++ b/paludis/args/args_error.cc
@@ -33,3 +33,13 @@ ArgsError::ArgsError(const std::string & our_message) throw () :
{
}
+BadValue::BadValue(const std::string& option, const std::string& value) throw () :
+ ArgsError("Invalid parameter '" + value + "' for argument '" + option + "'")
+{
+}
+
+MissingValue::MissingValue(const std::string & arg) throw() :
+ ArgsError("No parameter given for '" + arg + "'")
+{
+}
+
diff --git a/paludis/args/args_error.hh b/paludis/args/args_error.hh
index b5511eb..2f5b631 100644
--- a/paludis/args/args_error.hh
+++ b/paludis/args/args_error.hh
@@ -39,7 +39,8 @@ namespace paludis
* \ingroup grplibpaludisargs
* \ingroup grpexceptions
*/
- class ArgsError : public paludis::Exception
+ class PALUDIS_VISIBLE ArgsError :
+ public paludis::Exception
{
protected:
/**
@@ -47,6 +48,39 @@ namespace paludis
*/
ArgsError(const std::string & message) throw ();
};
+
+ /**
+ * Thrown if an invalid parameter is passed to a valid command line argument.
+ *
+ * \ingroup grplibpaludisargs
+ * \ingroup grpexceptions
+ */
+ class PALUDIS_VISIBLE BadValue :
+ public ArgsError
+ {
+ public:
+ /**
+ * Constructor
+ */
+ BadValue(const std::string& option, const std::string& value) throw();
+ };
+
+ /**
+ * Thrown if an argument is specified that needs a parameter,
+ * but no parameter is given.
+ *
+ * \ingroup grplibpaludisargs
+ * \ingroup grpexceptions
+ */
+ class PALUDIS_VISIBLE MissingValue :
+ public ArgsError
+ {
+ public:
+ /**
+ * Constructor.
+ */
+ MissingValue(const std::string & arg) throw ();
+ };
}
}
diff --git a/paludis/args/args_group.hh b/paludis/args/args_group.hh
index d0571f6..62b363d 100644
--- a/paludis/args/args_group.hh
+++ b/paludis/args/args_group.hh
@@ -45,7 +45,7 @@ namespace paludis
*
* \ingroup grplibpaludisargs
*/
- class ArgsGroup :
+ class PALUDIS_VISIBLE ArgsGroup :
private PrivateImplementationPattern<ArgsGroup>,
private InstantiationPolicy<ArgsGroup, instantiation_method::NonCopyableTag>
{
diff --git a/paludis/args/args_handler.hh b/paludis/args/args_handler.hh
index ece0729..85e486d 100644
--- a/paludis/args/args_handler.hh
+++ b/paludis/args/args_handler.hh
@@ -44,7 +44,7 @@ namespace paludis
*
* \ingroup grplibpaludisargs
*/
- class ArgsHandler :
+ class PALUDIS_VISIBLE ArgsHandler :
private InstantiationPolicy<ArgsHandler, instantiation_method::NonCopyableTag>,
private PrivateImplementationPattern<ArgsHandler>
{
@@ -174,7 +174,7 @@ namespace paludis
*
* \ingroup grplibpaludisargs
*/
- std::ostream & operator<< (std::ostream &, const ArgsHandler &);
+ std::ostream & operator<< (std::ostream &, const ArgsHandler &) PALUDIS_VISIBLE;
}
}
diff --git a/paludis/args/args_option.cc b/paludis/args/args_option.cc
index dbe0eff..3ab90bd 100644
--- a/paludis/args/args_option.cc
+++ b/paludis/args/args_option.cc
@@ -18,7 +18,7 @@
*/
#include "args.hh"
-#include "bad_value.hh"
+#include "args_error.hh"
#include <set>
#include <vector>
diff --git a/paludis/args/args_option.hh b/paludis/args/args_option.hh
index 9a93592..a46ee5e 100644
--- a/paludis/args/args_option.hh
+++ b/paludis/args/args_option.hh
@@ -41,7 +41,8 @@ namespace paludis
*
* \ingroup grplibpaludisargs
*/
- class ArgsOption : public virtual VisitableInterface<ArgsVisitorTypes>
+ class PALUDIS_VISIBLE ArgsOption :
+ public virtual VisitableInterface<ArgsVisitorTypes>
{
friend class ArgsHandler;
@@ -55,7 +56,6 @@ namespace paludis
bool _specified;
ArgsOption(const ArgsOption &);
-
void operator= (const ArgsOption &);
protected:
@@ -120,14 +120,16 @@ namespace paludis
return _group;
}
};
-
+
/**
* A SwitchArg is an option that can either be specified or not
* specified, and that takes no value (for example, --help).
*
* \ingroup grplibpaludisargs
*/
- class SwitchArg : public ArgsOption, public Visitable<SwitchArg, ArgsVisitorTypes>
+ class PALUDIS_VISIBLE SwitchArg :
+ public ArgsOption,
+ public Visitable<SwitchArg, ArgsVisitorTypes>
{
public:
/**
@@ -138,19 +140,20 @@ namespace paludis
~SwitchArg();
};
-
+
/**
* An option that takes a string argument.
*
* \ingroup grplibpaludisargs
*/
- class StringArg : public ArgsOption, public Visitable<StringArg, ArgsVisitorTypes>
+ class PALUDIS_VISIBLE StringArg :
+ public ArgsOption,
+ public Visitable<StringArg, ArgsVisitorTypes>
{
private:
std::string _argument;
public:
-
/**
* Constructor
*/
@@ -173,7 +176,7 @@ namespace paludis
*
* \ingroup grplibpaludisargs
*/
- class StringSetArg :
+ class PALUDIS_VISIBLE StringSetArg :
public ArgsOption,
public Visitable<StringSetArg, ArgsVisitorTypes>,
private PrivateImplementationPattern<StringSetArg>
@@ -212,7 +215,9 @@ namespace paludis
*
* \ingroup grplibpaludisargs
*/
- class AliasArg : public ArgsOption, public Visitable<AliasArg, ArgsVisitorTypes>
+ class PALUDIS_VISIBLE AliasArg :
+ public ArgsOption,
+ public Visitable<AliasArg, ArgsVisitorTypes>
{
private:
ArgsOption * const _other;
@@ -233,13 +238,15 @@ namespace paludis
_other->set_specified(value);
}
};
-
+
/**
* An option that takes an integer argument.
*
* \ingroup grplibpaludisargs
*/
- class IntegerArg : public ArgsOption, public Visitable<IntegerArg, ArgsVisitorTypes>
+ class PALUDIS_VISIBLE IntegerArg :
+ public ArgsOption,
+ public Visitable<IntegerArg, ArgsVisitorTypes>
{
private:
int _argument;
@@ -266,7 +273,7 @@ namespace paludis
*
* \ingroup grplibpaludisargs
*/
- class EnumArg :
+ class PALUDIS_VISIBLE EnumArg :
public ArgsOption,
public Visitable<EnumArg, ArgsVisitorTypes>,
private PrivateImplementationPattern<EnumArg>
@@ -283,7 +290,7 @@ namespace paludis
*
* \ingroup grplibpaludisargs
*/
- class EnumArgOptions :
+ class PALUDIS_VISIBLE EnumArgOptions :
private PrivateImplementationPattern<EnumArgOptions>
{
friend class EnumArg;
diff --git a/paludis/args/args_visitor.cc b/paludis/args/args_visitor.cc
index b96a634..a43f714 100644
--- a/paludis/args/args_visitor.cc
+++ b/paludis/args/args_visitor.cc
@@ -17,8 +17,7 @@
*/
#include "args_option.hh"
-#include "bad_value.hh"
-#include "missing_value.hh"
+#include "args_error.hh"
#include <paludis/util/visitor.hh>
#include <paludis/util/destringify.hh>
diff --git a/paludis/args/args_visitor.hh b/paludis/args/args_visitor.hh
index 2643953..822ae8e 100644
--- a/paludis/args/args_visitor.hh
+++ b/paludis/args/args_visitor.hh
@@ -22,6 +22,7 @@
#define PALUDIS_GUARD_ARGS_ARGS_VISITOR_HH 1
#include <paludis/util/visitor.hh>
+#include <paludis/util/attributes.hh>
#include <string>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
@@ -57,7 +58,8 @@ namespace paludis
*
* \ingroup grplibpaludisargs
*/
- class ArgsVisitor : public ArgsVisitorTypes::Visitor
+ class PALUDIS_VISIBLE ArgsVisitor :
+ public ArgsVisitorTypes::Visitor
{
private:
libwrapiter::ForwardIterator<ArgsVisitor, std::string> * _args_index, _args_end;
diff --git a/paludis/args/bad_argument.hh b/paludis/args/bad_argument.hh
index 361b79b..92660e8 100644
--- a/paludis/args/bad_argument.hh
+++ b/paludis/args/bad_argument.hh
@@ -39,7 +39,8 @@ namespace paludis
* \ingroup grplibpaludisargs
* \ingroup grpexceptions
*/
- class BadArgument : public ArgsError
+ class PALUDIS_VISIBLE BadArgument :
+ public ArgsError
{
public:
/**
diff --git a/paludis/args/bad_value.cc b/paludis/args/bad_value.cc
deleted file mode 100644
index 9cea753..0000000
--- a/paludis/args/bad_value.cc
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "bad_value.hh"
-
-/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/** \file
- * Implementation for BadValue
- *
- * \ingroup Args
- * \ingroup Exception
- */
-
-using namespace paludis::args;
-
-BadValue::BadValue(const std::string& option, const std::string& value) throw () :
- ArgsError("Invalid parameter '" + value + "' for argument '" + option + "'")
-{
-}
diff --git a/paludis/args/bad_value.hh b/paludis/args/bad_value.hh
deleted file mode 100644
index e9c0d37..0000000
--- a/paludis/args/bad_value.hh
+++ /dev/null
@@ -1,53 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_ARGS_BAD_VALUE_HH
-#define PALUDIS_GUARD_ARGS_BAD_VALUE_HH 1
-
-#include <paludis/args/args_error.hh>
-
-/** \file
- * Declaration for BadValue.
- *
- * \ingroup grplibpaludisargs
- * \ingroup grpexceptions
- */
-
-namespace paludis
-{
- namespace args
- {
- /**
- * Thrown if an invalid parameter is passed to a valid command line argument.
- *
- * \ingroup grplibpaludisargs
- * \ingroup grpexceptions
- */
- class BadValue : public ArgsError
- {
- public:
- /**
- * Constructor
- */
- BadValue(const std::string& option, const std::string& value) throw();
- };
- }
-}
-
-#endif
diff --git a/paludis/args/man.hh b/paludis/args/man.hh
index dce073f..220707e 100644
--- a/paludis/args/man.hh
+++ b/paludis/args/man.hh
@@ -30,7 +30,7 @@ namespace paludis
/**
* Write a man page to an ostream.
*/
- void generate_man(std::ostream &, const ArgsHandler * const h);
+ void generate_man(std::ostream &, const ArgsHandler * const h) PALUDIS_VISIBLE;
}
}
diff --git a/paludis/args/missing_value.cc b/paludis/args/missing_value.cc
deleted file mode 100644
index 2474ea5..0000000
--- a/paludis/args/missing_value.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "missing_value.hh"
-
-/**
- * \file
- * Implementation of MissingValue
- *
- * \ingroup Args
- * \ingroup Exception
- */
-
-using namespace paludis::args;
-
-MissingValue::MissingValue(const std::string & arg) throw() :
- ArgsError("No parameter given for '" + arg + "'")
-{
-}
diff --git a/paludis/args/missing_value.hh b/paludis/args/missing_value.hh
deleted file mode 100644
index 9873ff0..0000000
--- a/paludis/args/missing_value.hh
+++ /dev/null
@@ -1,55 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_ARGS_MISSING_VALUE_HH
-#define PALUDIS_GUARD_PALUDIS_ARGS_MISSING_VALUE_HH 1
-
-#include <paludis/args/args_error.hh>
-
-/** \file
- * Declaration for MissingValue
- *
- * \ingroup grplibpaludisargs
- * \ingroup grpexceptions
- */
-
-namespace paludis
-{
- namespace args
- {
- /**
- * Thrown if an argument is specified that needs a parameter,
- * but no parameter is given.
- *
- * \ingroup grplibpaludisargs
- * \ingroup grpexceptions
- */
- class MissingValue : public ArgsError
- {
- public:
- /**
- * Constructor.
- */
- MissingValue(const std::string & arg) throw ();
- };
- }
-}
-
-#endif
diff --git a/paludis/digests/Makefile.am b/paludis/digests/Makefile.am
index 5871029..4d00875 100644
--- a/paludis/digests/Makefile.am
+++ b/paludis/digests/Makefile.am
@@ -26,7 +26,7 @@ EXTRA_DIST = sha256_TEST.cc rmd160_TEST.cc md5_TEST.cc
check_PROGRAMS = $(TESTS)
-AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@ @PALUDIS_CXXFLAGS_VISIBILITY@
sha256_TEST_SOURCES = sha256_TEST.cc
sha256_TEST_CXXFLAGS = -I$(top_srcdir)
@@ -40,4 +40,3 @@ md5_TEST_SOURCES = md5_TEST.cc
md5_TEST_CXXFLAGS = -I$(top_srcdir)
md5_TEST_LDADD = $(top_builddir)/test/libtest.a libpaludisdigests.la
-
diff --git a/paludis/digests/md5.hh b/paludis/digests/md5.hh
index 0e37796..e4da004 100644
--- a/paludis/digests/md5.hh
+++ b/paludis/digests/md5.hh
@@ -32,7 +32,7 @@ namespace paludis
*
* \ingroup grplibpaludisdigests
*/
- class MD5
+ class PALUDIS_VISIBLE MD5
{
private:
static const uint32_t _t[64];
diff --git a/paludis/digests/rmd160.hh b/paludis/digests/rmd160.hh
index ab94300..dddae28 100644
--- a/paludis/digests/rmd160.hh
+++ b/paludis/digests/rmd160.hh
@@ -32,7 +32,7 @@ namespace paludis
*
* \ingroup grplibpaludisdigests
*/
- class RMD160
+ class PALUDIS_VISIBLE RMD160
{
private:
static const uint8_t _r[80], _rp[80];
diff --git a/paludis/digests/sha256.hh b/paludis/digests/sha256.hh
index eb9975e..72852c3 100644
--- a/paludis/digests/sha256.hh
+++ b/paludis/digests/sha256.hh
@@ -32,7 +32,7 @@ namespace paludis
*
* \ingroup grplibpaludisdigests
*/
- class SHA256
+ class PALUDIS_VISIBLE SHA256
{
private:
static const uint32_t _k[64];
diff --git a/paludis/repositories/virtuals/Makefile.am b/paludis/repositories/virtuals/Makefile.am
index ae1f600..d29e451 100644
--- a/paludis/repositories/virtuals/Makefile.am
+++ b/paludis/repositories/virtuals/Makefile.am
@@ -2,7 +2,7 @@ CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
DISTCLEANFILES = vr_entry-sr.hh vr_entry-sr.cc
MAINTAINERCLEANFILES = Makefile.in
-AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@ @PALUDIS_CXXFLAGS_VISIBILITY@
DEFS= \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index db5c82a..c76506b 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -299,3 +299,15 @@ InstalledVirtualsRepository::do_uninstall(const QualifiedPackageName &, const Ve
{
}
+#ifdef PALUDIS_ENABLE_VISIBILITY
+# pragma GCC visibility push(default)
+#endif
+namespace
+{
+ const RepositoryMaker::RegisterMaker register_installed_virtuals_repository PALUDIS_ATTRIBUTE((used)) (
+ "installed_virtuals", &InstalledVirtualsRepository::make_installed_virtuals_repository);
+}
+#ifdef PALUDIS_ENABLE_VISIBILITY
+# pragma GCC visibility pop
+#endif
+
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.hh b/paludis/repositories/virtuals/installed_virtuals_repository.hh
index ffe95f7..c145ecc 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.hh
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.hh
@@ -24,7 +24,7 @@
namespace paludis
{
- class InstalledVirtualsRepository :
+ class PALUDIS_VISIBLE InstalledVirtualsRepository :
public Repository,
public RepositoryInstalledInterface,
public RepositoryUninstallableInterface,
@@ -86,9 +86,6 @@ namespace paludis
return false;
}
};
-
- static const RepositoryMaker::RegisterMaker register_installed_virtuals_repository(
- "installed_virtuals", &InstalledVirtualsRepository::make_installed_virtuals_repository);
}
#endif
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 14088a6..c68047c 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -293,3 +293,15 @@ VirtualsRepository::do_install(const QualifiedPackageName &, const VersionSpec &
{
}
+#ifdef PALUDIS_ENABLE_VISIBILITY
+# pragma GCC visibility push(default)
+#endif
+namespace
+{
+ const RepositoryMaker::RegisterMaker register_virtuals_repository PALUDIS_ATTRIBUTE((used)) (
+ "virtuals", &VirtualsRepository::make_virtuals_repository);
+}
+#ifdef PALUDIS_ENABLE_VISIBILITY
+# pragma GCC visibility pop
+#endif
+
diff --git a/paludis/repositories/virtuals/virtuals_repository.hh b/paludis/repositories/virtuals/virtuals_repository.hh
index d0f2212..10cb520 100644
--- a/paludis/repositories/virtuals/virtuals_repository.hh
+++ b/paludis/repositories/virtuals/virtuals_repository.hh
@@ -24,7 +24,7 @@
namespace paludis
{
- class VirtualsRepository :
+ class PALUDIS_VISIBLE VirtualsRepository :
public Repository,
public RepositoryInstallableInterface,
public RepositoryMaskInterface,
@@ -82,9 +82,6 @@ namespace paludis
}
};
-
- static const RepositoryMaker::RegisterMaker register_virtuals_repository(
- "virtuals", &VirtualsRepository::make_virtuals_repository);
}
#endif
diff --git a/paludis/repositories/virtuals/vr_entry.hh b/paludis/repositories/virtuals/vr_entry.hh
index 6e5f311..86206fd 100644
--- a/paludis/repositories/virtuals/vr_entry.hh
+++ b/paludis/repositories/virtuals/vr_entry.hh
@@ -114,7 +114,6 @@ namespace paludis
return a.virtual_name.category;
}
};
-
}
#endif
diff --git a/paludis/selinux/Makefile.am b/paludis/selinux/Makefile.am
index c17d410..bcb56c1 100644
--- a/paludis/selinux/Makefile.am
+++ b/paludis/selinux/Makefile.am
@@ -20,6 +20,6 @@ EXTRA_DIST =
check_PROGRAMS = $(TESTS)
-AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@ @PALUDIS_CXXFLAGS_VISIBILITY@
diff --git a/paludis/selinux/security_context.hh b/paludis/selinux/security_context.hh
index b0323ee..1388faa 100644
--- a/paludis/selinux/security_context.hh
+++ b/paludis/selinux/security_context.hh
@@ -33,7 +33,8 @@
* \ingroup grplibpaludisselinux
*/
-namespace paludis {
+namespace paludis
+{
class FSCreateCon;
class MatchPathCon;
@@ -43,7 +44,8 @@ namespace paludis {
* \ingroup grplibpaludisselinux
* \ingroup grpexceptions
*/
- class SELinuxException : public Exception
+ class PALUDIS_VISIBLE SELinuxException :
+ public Exception
{
public:
/// Constructor.
@@ -58,9 +60,10 @@ namespace paludis {
*
* \ingroup grplibpaludisselinux
*/
- class SecurityContext : private PrivateImplementationPattern<SecurityContext>,
- private InstantiationPolicy<SecurityContext, instantiation_method::NonCopyableTag>,
- public InternalCounted<SecurityContext>
+ class PALUDIS_VISIBLE SecurityContext :
+ private PrivateImplementationPattern<SecurityContext>,
+ private InstantiationPolicy<SecurityContext, instantiation_method::NonCopyableTag>,
+ public InternalCounted<SecurityContext>
{
public:
/**
@@ -98,7 +101,7 @@ namespace paludis {
*
* \ingroup grplibpaludisselinux
*/
- std::ostream& operator<<(std::ostream&, const SecurityContext &);
+ std::ostream& operator<<(std::ostream&, const SecurityContext &) PALUDIS_VISIBLE;
/**
* RAII-style wrapper for setfscreatecon().
@@ -111,7 +114,7 @@ namespace paludis {
*
* \ingroup grplibpaludisselinux
*/
- class FSCreateCon
+ class PALUDIS_VISIBLE FSCreateCon
{
private:
SecurityContext::ConstPointer _context;
@@ -134,7 +137,8 @@ namespace paludis {
*
* \ingroup grplibpaludisselinux
*/
- class MatchPathCon : public InstantiationPolicy<MatchPathCon, instantiation_method::SingletonAsNeededTag>
+ class PALUDIS_VISIBLE MatchPathCon :
+ public InstantiationPolicy<MatchPathCon, instantiation_method::SingletonAsNeededTag>
{
private:
bool _good;
diff --git a/paludis/tasks/Makefile.am b/paludis/tasks/Makefile.am
index bcb445b..07ce51b 100644
--- a/paludis/tasks/Makefile.am
+++ b/paludis/tasks/Makefile.am
@@ -1,6 +1,6 @@
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
MAINTAINERCLEANFILES = Makefile.in
-AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@ @PALUDIS_CXXFLAGS_VISIBILITY@
DEFS= \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
diff --git a/paludis/tasks/install_task.hh b/paludis/tasks/install_task.hh
index 9d7c90f..187075b 100644
--- a/paludis/tasks/install_task.hh
+++ b/paludis/tasks/install_task.hh
@@ -28,21 +28,21 @@ namespace paludis
{
class Environment;
- class MultipleSetTargetsSpecified :
+ class PALUDIS_VISIBLE MultipleSetTargetsSpecified :
public Exception
{
public:
MultipleSetTargetsSpecified() throw ();
};
- class HadBothPackageAndSetTargets :
+ class PALUDIS_VISIBLE HadBothPackageAndSetTargets :
public Exception
{
public:
HadBothPackageAndSetTargets() throw ();
};
- class InstallTask :
+ class PALUDIS_VISIBLE InstallTask :
PrivateImplementationPattern<InstallTask>,
InstantiationPolicy<InstallTask, instantiation_method::NonCopyableTag>
{
diff --git a/paludis/tasks/sync_task.hh b/paludis/tasks/sync_task.hh
index ee33efe..baedfd7 100644
--- a/paludis/tasks/sync_task.hh
+++ b/paludis/tasks/sync_task.hh
@@ -29,7 +29,7 @@ namespace paludis
class Environment;
class SyncFailedError;
- class SyncTask :
+ class PALUDIS_VISIBLE SyncTask :
PrivateImplementationPattern<SyncTask>,
InstantiationPolicy<SyncTask, instantiation_method::NonCopyableTag>
{
diff --git a/paludis/tasks/uninstall_task.hh b/paludis/tasks/uninstall_task.hh
index 84d341e..5820bca 100644
--- a/paludis/tasks/uninstall_task.hh
+++ b/paludis/tasks/uninstall_task.hh
@@ -29,7 +29,7 @@ namespace paludis
{
class Environment;
- class AmbiguousUnmergeTargetError :
+ class PALUDIS_VISIBLE AmbiguousUnmergeTargetError :
public Exception
{
private:
@@ -65,7 +65,7 @@ namespace paludis
}
};
- class UninstallTask :
+ class PALUDIS_VISIBLE UninstallTask :
PrivateImplementationPattern<UninstallTask>,
InstantiationPolicy<UninstallTask, instantiation_method::NonCopyableTag>
{
diff --git a/paludis/util/Makefile.am.m4 b/paludis/util/Makefile.am.m4
index cc98d7d..3c02276 100644
--- a/paludis/util/Makefile.am.m4
+++ b/paludis/util/Makefile.am.m4
@@ -31,13 +31,13 @@ include(`paludis/util/files.m4')
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
MAINTAINERCLEANFILES = Makefile.in Makefile.am paludis.hh \
- hashed_containers.hh util.hh
+ hashed_containers.hh util.hh attributes.hh
AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
DEFS=\
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\"
EXTRA_DIST = util.hh.m4 Makefile.am.m4 files.m4 \
- testscriptlist test_extras.cc
+ testscriptlist test_extras.cc attributes.hh.in
SUBDIRS = .
libpaludisutil_la_SOURCES = filelist
diff --git a/paludis/util/attributes.hh b/paludis/util/attributes.hh.in
index 63ce662..f5f83b5 100644
--- a/paludis/util/attributes.hh
+++ b/paludis/util/attributes.hh.in
@@ -51,4 +51,13 @@
# define PALUDIS_ATTRIBUTE(x)
#endif
+#define PALUDIS_ENABLE_VISIBILITY @PALUDIS_ENABLE_VISIBILITY@
+#if PALUDIS_ENABLE_VISIBILITY
+# define PALUDIS_VISIBLE PALUDIS_ATTRIBUTE((visibility("default")))
+# define PALUDIS_HIDDEN PALUDIS_ATTRIBUTE((visibility("hidden")))
+#else
+# define PALUDIS_VISIBLE
+# define PALUDIS_HIDDEN
+#endif
+
#endif