Welcome back, hjclub.
Why did you certify fredericpete821 when that's clearly a spammer account? You got kicked out once before for doing that, after being advised not to.
Certifying spammers is not how to interact with this community
std::bind
can do that lambdas can't.
#include <functional>
#include <string>
#include <iostream>
struct Polly
{
template<typename T, typename U>
auto operator()(T t, U u) const -> decltype(t + u)
{ return t + u; }
};
int main()
{
auto polly = std::bind(Polly(), std::placeholders::_1, "confusing");
std::cout << polly(4) << polly(std::string(" this is ")) << std::endl;
}
I wrote previously about needing to hack the clang sources to build it with gcc in a non-standard location. That patch is no longer necessary, to enable it to find the GCC headers and runtime files I now configure it as:
GCC_DIR=/your/gcc/prefix
GCC_VER=4.4.3
GCC_ARCH=x86_64-unknown-linux-gnu
../llvm/configure --prefix=$PREFIX --enable-targets=host \
--enable-optimized --disable-jit \
LDFLAGS=-Wl,-R,$GCC_DIR/lib64 \
--with-cxx-include-root=$GCC_DIR/include/c++/$GCC_VER \
--with-cxx-include-arch=$GCC_ARCH
make CFLAGS=-std=gnu89
Building GCC is not trivial, but is not difficult if you follow the instructions carefully.
Many people rush into trying to build it without reading the installation docs properly and make one or more of these common mistakes:
1) do not run ./configure - this is not supported, you need to run configure from outside the source directory
2) if GCC links dynamically to the prerequisite libs (GMP/MPFR/MPC) then the shared libraries must be in the dynamic linker's path, both when building gcc and when using the installed compiler.
These problems are easily avoided by reading http://gcc.gnu.org/install/prerequisites.html, http://gcc.gnu.org/install/configure.html, http://gcc.gnu.org/wiki/FAQ#configure and http://gcc.gnu.org/wiki/FAQ#configure_suffix but noone does that.
For the impatient or RTFM-intolerant, a foolproof recipe for building GCC is given below.
The trick to this recipe is that the GMP, MPFR and MPC prerequisites are not installed separately, they are built as part of gcc and linked to statically. This avoids the common problem of installing the shared libraries in a non-standard location and having to tell the dynamic linker how to find them. This method is documented at http://gcc.gnu.org/install/prerequisites.html and is much easier than building and installing the prerequisites separately, but everyone seems to choose the hard way.
THIS RECIPE IS NOT A SUBSTITUTE FOR RTFM.
If you decide to stray from this recipe without reading the docs do not be surprised if you get indigestion.
* Ingredients:
1 gcc source package (e.g. gcc-4.6.2.tar.gz)
Alternatively, download individual packages for each GCC language front end (e.g. gcc-core, gcc-g++ etc.)
* Method:
First prepare your environment, season these variables to taste:
# the version you will build
gccver=4.6.2
# where you put the downloaded source packages
pkgdir=$HOME
# where you will build gcc
rootdir=$HOME/gcc-tmp
# where you want to install gcc
prefix=/opt/gcc-${gccver}
# the languages you want gcc to support
langs=c,c++
mkdir ${rootdir}
cd ${rootdir}
tar xzf ${pkgdir}/gcc-${gccver}.tar.gz
cd gcc-${gccver}
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
${rootdir}/gcc-${gccver}/configure --prefix=${prefix} --enable-languages=${langs}
make
make install
RIP, dmr
robogato, wouldn't using libxml2's html-output (e.g. htmlDocDumpMemoryFormat) ensure it outputs <em></em> instead of <em/>?
I'm not sure how that would work with syndicated posts, do they get parsed into an xmlDoc first, then dumped out again?
recentlog seems to stop rendering after the <iframe> in bagder's post, I'm not sure why
New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.
Keep up with the latest Advogato features by reading the Advogato status blog.
If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!