diff -r 18fc23cf45d8 -r 7674d15b15bc metamod/engineinfo.cpp --- a/metamod/engineinfo.cpp Thu Sep 26 15:06:51 2013 -0500 +++ b/metamod/engineinfo.cpp Thu Sep 26 15:21:07 2013 -0500 @@ -23,7 +23,6 @@ # include # include // dladdr() # include // Mach-O structures -# include // Mach-O structures for fat binaries #endif /* _WIN32 */ #include // strlen(), strrchr(), strcmp() @@ -388,35 +387,14 @@ int EngineInfo::mhdr_machohdr( void* pMachoHdr ) { - fat_header* pFatHdr = (fat_header *)pMachoHdr; mach_header* pHdr = (mach_header *)pMachoHdr; - fat_arch* pFatArchs; segment_command *pSegment; section *pSection; - uint32_t nArchs; uint32_t nCmds; uint32_t nSections; if ( NULL == pMachoHdr ) return INVALID_ARG; - // Check for fat binary first. - // Note that fat_header and fat_arch are always stored in big-endian. - if ( CFSwapInt32BigToHost( pFatHdr->magic ) == FAT_MAGIC ) { - nArchs = CFSwapInt32BigToHost( pFatHdr->nfat_arch ); - pFatArchs = (fat_arch *) ((char *) pMachoHdr + sizeof(fat_header)); - - // Look for the 32-bit Mach-O header - for (uint32_t i = 0; i < nArchs; i++) { - if ( CFSwapInt32BigToHost( pFatArchs[i].cputype ) == CPU_TYPE_I386 - && CFSwapInt32BigToHost ( pFatArchs[i].cpusubtype ) == CPU_SUBTYPE_I386_ALL ) { - - pHdr = (mach_header *) ((char *) pMachoHdr + CFSwapInt32BigToHost( pFatArchs[i].offset )); - break; - } - } - - } - // Find __TEXT segment and __text section if ( pHdr->magic == MH_MAGIC && pHdr->filetype == MH_DYLIB ) {