add standard guards instead of pragma once, add extern to allow C++ compilation