fix layer_factory.cpp bug: there should be no ifdefs

This is a simple fix - the ifdefs are there probably because layer_factory used to be a header file.