Mac OSX compatibility (tested with gcc 4.2.1)