this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

More work, Clang compilation fixes

+139 -87
+7 -1
CMakeLists.txt
··· 6 6 endif(COMMAND cmake_policy) 7 7 8 8 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) 9 + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 9 10 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/xnu) 10 11 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/xnu/bsd) 11 12 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/darwin) 12 13 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/libmach-o) 13 14 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/util) 15 + 16 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") 14 17 15 18 configure_file(config.h.in config.h) 16 19 ··· 32 35 set(dyld_SRCS 33 36 src/dyld/FileMap.cpp 34 37 src/dyld/MachOLoader.cpp 38 + src/dyld/ld.cpp 39 + src/dyld/dyld.cpp 35 40 src/util/log.cc 36 41 src/util/trace.cpp 37 42 ) ··· 50 55 51 56 install(TARGETS dyld fatmacho-extract DESTINATION bin) 52 57 53 - add_subdirectory(src/libSystem src/libunwind-darwin) 58 + add_subdirectory(src/libSystem) 59 + add_subdirectory(src/libunwind-darwin) 54 60
+22
config.h.in
··· 3 3 4 4 #define LIB_PATH "${CMAKE_INSTALL_PREFIX}/lib/darling" 5 5 6 + /* 7 + * Credit: 8 + * 9 + * David Chisnall 10 + * http://comments.gmane.org/gmane.comp.desktop.etoile.devel/1556 11 + * 12 + * */ 13 + 14 + #ifdef __block 15 + # undef __block 16 + # include <unistd.h> 17 + # define __block __attribute__((__blocks__(byref))) 18 + #else 19 + # include <unistd.h> 20 + #endif 21 + 22 + #include <stdint.h> 23 + 24 + #define __uint64_t uint64_t 25 + /* #define __darwin_natural_t long */ 26 + 27 + 6 28 #endif
+45 -30
src/dyld/MachOLoader.cpp
··· 3 3 #include "ld.h" 4 4 #include "log.h" 5 5 #include "trace.h" 6 + #include "FileMap.h" 7 + #include <limits.h> 8 + #include <iostream> 9 + #include <cstring> 6 10 #include <cstdio> 7 11 #include <cassert> 8 12 #include <algorithm> 9 13 #include <sstream> 10 14 #include <stdexcept> 15 + #include <set> 11 16 #include <sys/mman.h> 17 + #include <errno.h> 12 18 13 19 #define FLAGS_TRACE_FUNCTIONS 0 14 20 ··· 18 24 static std::set<std::string> g_no_trampoline; 19 25 20 26 extern char g_darwin_executable_path[PATH_MAX]; 27 + extern int g_argc; 28 + extern char** g_argv; 21 29 22 - static void initNoTrampoline() __attribute__((constructor)) 30 + __attribute__((constructor)) static void initNoTrampoline() 23 31 { 24 32 #define NO_TRAMPOLINE(name) g_no_trampoline.insert(#name); 25 33 #include "no_trampoline.tab" ··· 197 205 { 198 206 LOG << "will rebase: filename=" << mach.filename() 199 207 << ", vmaddr=" << (void*)vmaddr 200 - << ", last_addr=" << (void*)last_addr_ <<std::endl; 208 + << ", last_addr=" << (void*)m_last_addr <<std::endl; 201 209 assert(i == 0); 202 - vmaddr = last_addr_; 210 + vmaddr = m_last_addr; 203 211 *slide = vmaddr - seg->vmaddr; 204 212 } 205 213 *base = std::min(*base, vmaddr); ··· 217 225 mach.fd(), mach.offset() + seg->fileoff); 218 226 219 227 if (mapped == MAP_FAILED) 220 - err(1, "%s mmap(file) failed", mach.filename().c_str()); 228 + { 229 + std::stringstream ss; 230 + ss << "Failed to mmap '" << mach.filename() << "': " << strerror(errno); 231 + throw std::runtime_error(ss.str()); 232 + } 221 233 222 234 if (vmsize != filesize) 223 235 { ··· 236 248 if (mapped == MAP_FAILED) 237 249 { 238 250 // TODO: insert a suggestion for a fix on 32bit systems 239 - err(1, "%s mmap(anon) failed", mach.filename().c_str()); 251 + std::stringstream ss; 252 + ss << "mmap(anon) failed on '" << mach.filename() << "': " << strerror(errno); 253 + throw std::runtime_error(ss.str()); 240 254 } 241 255 } 242 256 ··· 301 315 MachO::Bind* bind = mach.binds()[i]; 302 316 if (bind->name[0] != '_') 303 317 { 304 - LOG << bind->name << ": skipping" << endl; 318 + LOG << bind->name << ": skipping" << std::endl; 305 319 continue; 306 320 } 307 321 308 322 if (bind->type == BIND_TYPE_POINTER) 309 323 { 310 - string name = bind->name.substr(1); 324 + std::string name = bind->name.substr(1); 311 325 void** ptr = (void**)(bind->vmaddr + slide); 312 326 char* sym = 0; 313 327 ··· 320 334 else 321 335 { 322 336 last_weak_name = name; 323 - if (seen_weak_bind_index != seen_weak_binds_orig_size && !strcmp(seen_weak_binds_[seen_weak_bind_index].first.c_str(), name.c_str())) 337 + if (seen_weak_bind_index != seen_weak_binds_orig_size && !strcmp(m_seen_weak_binds[seen_weak_bind_index].first.c_str(), name.c_str())) 324 338 { 325 339 last_weak_sym = sym = 326 - seen_weak_binds_[seen_weak_bind_index].second; 340 + m_seen_weak_binds[seen_weak_bind_index].second; 327 341 seen_weak_bind_index++; 328 342 } 329 343 else ··· 334 348 } 335 349 else 336 350 { 337 - const Exports::const_iterator export_found = exports_.find(bind->name); 338 - if (export_found != exports_.end()) 351 + const Exports::const_iterator export_found = m_exports.find(bind->name); 352 + if (export_found != m_exports.end()) 339 353 *ptr = last_weak_sym = (char*)export_found->second.addr; 340 354 else 341 355 last_weak_sym = (char*)*ptr; 342 356 } 343 357 } 344 358 345 - seen_weak_binds_.push_back(make_pair(name, last_weak_sym)); 346 - while (seen_weak_bind_index != seen_weak_binds_orig_size && strcmp(seen_weak_binds_[seen_weak_bind_index].first.c_str(), name.c_str()) <= 0) 359 + m_seen_weak_binds.push_back(make_pair(name, last_weak_sym)); 360 + while (seen_weak_bind_index != seen_weak_binds_orig_size && strcmp(m_seen_weak_binds[seen_weak_bind_index].first.c_str(), name.c_str()) <= 0) 347 361 seen_weak_bind_index++; 348 362 349 363 continue; ··· 362 376 } 363 377 #endif 364 378 365 - sym = reinterpret_cast<char*>(__darwin_dlsym(DARWIN_RTLD_GLOBAL, name.c_str())); 379 + sym = reinterpret_cast<char*>(__darwin_dlsym(DARWIN_RTLD_DEFAULT, name.c_str())); 366 380 if (!sym) 367 381 { 368 382 std::stringstream ss; 369 383 ss << "Undefined symbol: " << name; 370 - throw std::runtime_error(ss); 384 + throw std::runtime_error(ss.str()); 371 385 } 372 386 373 387 sym += bind->addend; 374 388 } 375 389 376 390 LOG << "bind " << name << ": " 377 - << *ptr << " => " << (void*)sym << " @" << ptr << endl; 391 + << *ptr << " => " << (void*)sym << " @" << ptr << std::endl; 378 392 379 393 if (FLAGS_TRACE_FUNCTIONS && !g_no_trampoline.count(name)) 380 394 { 381 - LOG << "Generating trampoline for " << name << "..." << endl; 395 + LOG << "Generating trampoline for " << name << "..." << std::endl; 382 396 383 397 *ptr = &m_trampoline[0] + m_trampoline.size(); 384 398 g_bound_names[i] = name; ··· 415 429 { 416 430 std::stringstream ss; 417 431 ss << "Unknown bind type: " << bind->type; 418 - throw std::runtime_exception(ss.str()); 432 + throw std::runtime_error(ss.str()); 419 433 } 420 434 } 421 435 ··· 448 462 void MachOLoader::load(const MachO& mach, Exports* exports) 449 463 { 450 464 if (!exports) 451 - exports = m_exports; 465 + exports = &m_exports; 452 466 453 467 intptr slide = 0; 454 468 intptr base = 0; ··· 457 471 458 472 doRebase(mach, slide); 459 473 460 - runPendingInitFuncs(mach, slide); 474 + //char* apple[2] = { g_darwin_executable_path, 0}; 475 + loadInitFuncs(mach, slide /*, g_argc, g_argv, environ, apple*/); 461 476 462 477 loadDylibs(mach); 463 478 ··· 504 519 g_file_map.addWatchDog(m_last_addr + 1); 505 520 506 521 char* trampoline_start_addr = (char*)(((uintptr_t)&m_trampoline[0]) & ~0xfff); 507 - uint64_t trampoline_size = alignMem(&trampoline_[0] + m_trampoline.size() - trampoline_start_addr, 0x1000); 522 + uint64_t trampoline_size = alignMem(&m_trampoline[0] + m_trampoline.size() - trampoline_start_addr, 0x1000); 508 523 509 - ::mprotect(trampoline_start_addr, trampoline_size, PROT_READ | PROT_WRITE | PROT_EXEC); 524 + ::mprotect(trampoline_start_addr, trampoline_size, PROT_READ | PROT_WRITE | PROT_EXEC); 510 525 511 526 //g_timer.print(mach.filename().c_str()); 512 527 513 528 mach.close(); 514 529 515 - runInitFuncs(argc, argv, envp, apple); 530 + runPendingInitFuncs(argc, argv, envp, apple); 516 531 517 532 LOG << "booting from " << (void*)mach.entry() << "..." << std::endl; 518 533 ··· 570 585 571 586 // TODO: add 'apple'! 572 587 573 - __asm__ volatile(" mov %1, %%rax;\n" 588 + __asm__ volatile(" movl %1, %%eax;\n" 574 589 " mov %2, %%rdx;\n" 575 - " push $0;\n" 590 + " pushq $0;\n" 576 591 // TODO(hamaji): envp 577 - " push $0;\n" 592 + " pushq $0;\n" 578 593 ".loop64:\n" 579 - " sub $8, %%rdx;\n" 580 - " push (%%rdx);\n" 594 + " subq $8, %%rdx;\n" 595 + " pushq (%%rdx);\n" 581 596 " dec %%eax;\n" 582 597 " jnz .loop64;\n" 583 - " mov %1, %%eax;\n" 584 - " push %%rax;\n" 598 + " movl %1, %%eax;\n" 599 + " pushq %%rax;\n" 585 600 " jmp *%0;\n" 586 601 ::"r"(entry), "r"(argc), "r"(argv + argc), "r"(envp) 587 602 :"%rax", "%rdx");
+5 -7
src/dyld/MachOLoader.h
··· 3 3 #include <vector> 4 4 #include <string> 5 5 #include <map> 6 - #include <pair> 6 + #include <utility> 7 7 #include <stdint.h> 8 + #include "MachO.h" 8 9 #include "arch.h" 10 + #include "ld.h" 9 11 10 12 class MachOLoader 11 13 { ··· 13 15 public: 14 16 typedef segment_command_64 Segment; 15 17 private: 16 - static inline const vector<Segment*>& getSegments(const MachO& mach) { 17 - return mach.segments64(); 18 - } 18 + static inline const std::vector<Segment*>& getSegments(const MachO& mach) { return mach.segments64(); } 19 19 #else 20 20 public: 21 21 typedef segment_command Segment; 22 22 private: 23 - static inline const vector<Segment*>& getSegments(const MachO& mach) { 24 - return mach.segments(); 25 - } 23 + static inline const std::vector<Segment*>& getSegments(const MachO& mach) { return mach.segments(); } 26 24 #endif 27 25 28 26 public:
+4 -3
src/dyld/dyld.cpp
··· 5 5 #include <limits.h> 6 6 #include <cstdlib> 7 7 #include <stdexcept> 8 + #include <cstring> 8 9 9 10 char g_darwin_executable_path[PATH_MAX]; 10 11 char g_loader_path[PATH_MAX]; ··· 27 28 if (!::realpath(argv[1], g_darwin_executable_path)) 28 29 ::strcpy(g_darwin_executable_path, argv[1]); 29 30 30 - initSignalHandler(); 31 + //initSignalHandler(); 31 32 //initRename(); 32 - initNoTrampoline(); 33 + //initNoTrampoline(); 33 34 //initLibMac(); 34 35 //initDlfcn(); 35 36 ··· 53 54 g_loader = new MachOLoader; 54 55 g_argv = argv+1; 55 56 g_argc = argc-1; 56 - loader->run(*g_mainBinary, argc-1, argv+1, envp); 57 + g_loader->run(*g_mainBinary, argc-1, argv+1, envp); 57 58 58 59 delete g_loader; 59 60 g_loader = 0;
+35 -32
src/dyld/ld.cpp
··· 1 1 #define DARWIN_LD_INTERNAL 2 + #include "MachOLoader.h" 2 3 #include "ld.h" 3 4 #include "arch.h" 4 5 #include "MachO.h" 5 6 #include "mutex.h" 6 7 #include "trace.h" 7 8 #include "FileMap.h" 8 - #include <config.h> 9 + #include "config.h" 10 + #include "log.h" 9 11 #include <unistd.h> 10 12 #include <map> 11 13 #include <string> 14 + #include <cstring> 12 15 #include <limits.h> 13 16 14 - static Mutex g_ldMutex; 15 - static std::map<std::string, LoadedLibrary> g_ldLibraries; 17 + static Darling::Mutex g_ldMutex; 18 + static std::map<std::string, LoadedLibrary*> g_ldLibraries; 16 19 static __thread char g_ldError[256] = ""; 17 20 18 21 extern char g_darwin_executable_path[PATH_MAX]; ··· 35 38 36 39 void* __darwin_dlopen(const char* filename, int flag) 37 40 { 38 - TRACE(filename, flag); 41 + TRACE2(filename, flag); 39 42 40 - MutexLock l(g_ldMutex); 43 + Darling::MutexLock l(g_ldMutex); 41 44 42 45 g_ldError[0] = 0; 43 46 ··· 137 140 return 0; 138 141 } 139 142 140 - std::map<std::string,LoadedLibrary>::iterator it = g_ldLibraries.find(name); 143 + std::map<std::string,LoadedLibrary*>::iterator it = g_ldLibraries.find(name); 141 144 if (it != g_ldLibraries.end()) 142 145 { 143 146 // TODO: flags ··· 167 170 lib->refCount = 1; 168 171 lib->type = LoadedLibraryNative; 169 172 lib->nativeRef = d; 170 - lib->slide = lib->base = 0; 173 + //lib->slide = lib->base = 0; 171 174 172 175 g_ldLibraries[name] = lib; 173 176 return lib; ··· 191 194 lib->type = LoadedLibraryDylib; 192 195 lib->machoRef = machO; 193 196 194 - bool global = flags & RTLD_GLOBAL && !(flags & RTLD_LOCAL); 197 + bool global = flag & RTLD_GLOBAL && !(flag & RTLD_LOCAL); 195 198 196 199 if (!global) 197 200 { 198 201 lib->exports = new Exports; 199 - g_loader->load(*dylib_mach, lib->exports, true); 202 + g_loader->load(*machO, lib->exports); 200 203 } 201 204 else 202 - g_loader->load(*dylib_mach, 0, true); 205 + g_loader->load(*machO, 0); 203 206 204 - const char* apple[2] = { g_darwin_executable_path, 0 }; 207 + char* apple[2] = { g_darwin_executable_path, 0 }; 205 208 g_loader->runPendingInitFuncs(g_argc, g_argv, environ, apple); 206 209 207 210 g_ldLibraries[name] = lib; ··· 209 212 } 210 213 catch (const std::exception& e) 211 214 { 212 - strcpy(g_ldError, e.what().c_str()); 215 + strcpy(g_ldError, e.what()); 213 216 return 0; 214 217 } 215 218 } ··· 218 221 219 222 int __darwin_dlclose(void* handle) 220 223 { 221 - TRACE(handle); 224 + TRACE1(handle); 222 225 223 - MutexLock l(g_ldMutex); 226 + Darling::MutexLock l(g_ldMutex); 224 227 g_ldError[0] = 0; 225 228 226 229 if (!handle) 227 230 return 0; 228 231 229 - LoadedLibrary* lib = dynamic_cast<LoadedLibrary*>(handle); 230 - if (!lib) 232 + LoadedLibrary* lib = reinterpret_cast<LoadedLibrary*>(handle); 233 + /*if (!lib) 231 234 { 232 235 strcpy(g_ldError, "Invalid handle passed to __darwin_dlclose()"); 233 236 return -1; 234 - } 237 + }*/ 235 238 236 239 lib->refCount--; 237 240 ··· 244 247 // TODO: unmap in g_loader! 245 248 delete lib->exports; 246 249 247 - for (std::map<std::string,LoadedLibrary>::iterator it = g_ldLibraries.begin(); it != g_ldLibraries.end(); it++) 250 + for (std::map<std::string,LoadedLibrary*>::iterator it = g_ldLibraries.begin(); it != g_ldLibraries.end(); it++) 248 251 { 249 252 if (it->second == lib) 250 253 { ··· 261 264 262 265 const char* __darwin_dlerror(void) 263 266 { 264 - TRACE(); 267 + //TRACE(); 265 268 266 269 return g_ldError[0] ? g_ldError : 0; 267 270 } 268 271 269 272 void* __darwin_dlsym(void* handle, const char* symbol) 270 273 { 271 - TRACE(handle, symbol); 274 + TRACE2(handle, symbol); 272 275 273 - MutexLock l(g_ldMutex); 276 + Darling::MutexLock l(g_ldMutex); 274 277 g_ldError[0] = 0; 275 278 276 279 if (handle == DARWIN_RTLD_NEXT || handle == DARWIN_RTLD_SELF || handle == DARWIN_RTLD_MAIN_ONLY || !handle) 277 280 { 278 - LOG("Cannot yet handle certain DARWIN_RTLD_* search strategies, falling back to RTLD_DEFAULT"); 281 + LOG << "Cannot yet handle certain DARWIN_RTLD_* search strategies, falling back to RTLD_DEFAULT\n"; 279 282 handle = DARWIN_RTLD_DEFAULT; 280 283 } 281 284 ··· 293 296 return sym; 294 297 295 298 // Now try Darwin libraries 296 - const Exports& e = g_loader.getExports(); 297 - Exports::const_iterator itSym = lib->exports->find(symbol); 298 - if (itSym == e.const_end()) 299 + const Exports& e = g_loader->getExports(); 300 + Exports::const_iterator itSym = e.find(symbol); 301 + if (itSym == e.end()) 299 302 { 300 303 // Now try without a prefix 301 304 sym = ::dlsym(RTLD_DEFAULT, symbol); ··· 307 310 return 0; 308 311 } 309 312 else 310 - return itSym->second.addr; 313 + return reinterpret_cast<void*>(itSym->second.addr); 311 314 } 312 315 else 313 316 { 314 - LoadedLibrary* lib = dynamic_cast<LoadedLibrary*>(handle); 315 - if (!lib) 317 + LoadedLibrary* lib = reinterpret_cast<LoadedLibrary*>(handle); 318 + /*if (!lib) 316 319 { 317 320 strcpy(g_ldError, "Invalid handle passed to __darwin_dlsym()"); 318 321 return 0; 319 - } 322 + }*/ 320 323 321 324 if (lib->type == LoadedLibraryNative) 322 325 { ··· 340 343 return 0; 341 344 } 342 345 else 343 - return itSym->second.addr; 346 + return reinterpret_cast<void*>(itSym->second.addr); 344 347 } 345 348 } 346 349 } 347 350 348 351 int __darwin_dladdr(void *addr, Dl_info *info) 349 352 { 350 - TRACE(addr, info); 353 + TRACE2(addr, info); 351 354 352 - MutexLock l(g_ldMutex); 355 + Darling::MutexLock l(g_ldMutex); 353 356 g_ldError[0] = 0; 354 357 355 358
+2 -1
src/dyld/ld.h
··· 1 1 #ifndef DARWIN_LD_H 2 2 #define DARWIN_LD_H 3 3 #include <dlfcn.h> 4 - #include "MachOLoader.h" 4 + #include <unordered_map> 5 + //#include "MachOLoader.h" 5 6 6 7 #define DARWIN_RTLD_LAZY 0x1 7 8 #define DARWIN_RTLD_NOW 0x2
+2 -2
src/libunwind-darwin/CMakeLists.txt
··· 6 6 endif(COMMAND cmake_policy) 7 7 8 8 set (unwind_SRCS 9 - emutls.c 9 + # emutls.c 10 10 unwind-c.c 11 11 unwind-compat.c 12 12 unwind-dw2-fde-darwin.c ··· 16 16 ) 17 17 18 18 add_library(unwind-darwin SHARED ${unwind_SRCS}) 19 - target_link_libraries(unwind-darwin -Tlink.cmd) 19 + #target_link_libraries(unwind-darwin -Tlink.cmd) 20 20 install(TARGETS unwind-darwin DESTINATION lib)
+9 -5
src/libunwind-darwin/tconfig.h
··· 1 1 #define ATTRIBUTE_UNUSED 2 2 #include <stdlib.h> 3 3 #include <string.h> 4 + #include <assert.h> 4 5 #include "mcore.h" 5 6 #define SHARED 6 7 7 8 8 - #if 0 9 + /* 9 10 #define _Unwind_GetTextRelBase __darwin__Unwind_GetTextRelBase 10 11 #define _Unwind_GetDataRelBase __darwin__Unwind_GetDataRelBase 11 12 #define _Unwind_GetRegionStart __darwin__Unwind_GetRegionStart ··· 18 19 #define _Unwind_GetLanguageSpecificData __darwin__Unwind_GetLanguageSpecificData 19 20 #define _Unwind_FindEnclosingFunction __darwin__Unwind_FindEnclosingFunction 20 21 #define _Unwind_Find_FDE __darwin__Unwind_Find_FDE 22 + */ 23 + 21 24 #define _Unwind_RaiseException __darwin__Unwind_RaiseException 22 - #define _Unwind_ForcedUnwind __darwin__Unwind_ForcedUnwind 25 + /* #define _Unwind_ForcedUnwind __darwin__Unwind_ForcedUnwind */ 23 26 #define _Unwind_Resume __darwin__Unwind_Resume 24 27 #define _Unwind_Resume_or_Rethrow __darwin__Unwind_Resume_or_Rethrow 25 28 #define _Unwind_DeleteException __darwin__Unwind_DeleteException 26 - #define _Unwind_Backtrace __darwin__Unwind_Backtrace 27 - #define _Unwind_Find_FDE __darwin__Unwind_Find_FDE 29 + /* #define _Unwind_Backtrace __darwin__Unwind_Backtrace */ 30 + /* #define _Unwind_Find_FDE __darwin__Unwind_Find_FDE */ 28 31 29 - #endif 32 + #define gcc_assert assert 33 + #define gcc_unreachable() __builtin_unreachable()
+4 -3
src/libunwind-darwin/unwind-generic.h
··· 40 40 41 41 /* @@@ The IA-64 ABI uses uint64 throughout. Most places this is 42 42 inefficient for 32-bit and smaller machines. */ 43 - typedef unsigned _Unwind_Word __attribute__((__mode__(__unwind_word__))); 44 - typedef signed _Unwind_Sword __attribute__((__mode__(__unwind_word__))); 43 + typedef unsigned long _Unwind_Word /*__attribute__((__mode__(__unwind_word__)))*/; 44 + typedef signed long _Unwind_Sword /*__attribute__((__mode__(__unwind_word__)))*/; 45 45 #if defined(__ia64__) && defined(__hpux__) 46 46 typedef unsigned _Unwind_Ptr __attribute__((__mode__(__word__))); 47 47 #else ··· 57 57 58 58 /* The unwind interface uses reason codes in several contexts to 59 59 identify the reasons for failures or other actions. */ 60 + #ifndef __clang__ 60 61 typedef enum 61 62 { 62 63 _URC_NO_REASON = 0, ··· 69 70 _URC_INSTALL_CONTEXT = 7, 70 71 _URC_CONTINUE_UNWIND = 8 71 72 } _Unwind_Reason_Code; 72 - 73 + #endif 73 74 74 75 /* The unwind interface uses a pointer to an exception header object 75 76 as its representation of an exception being thrown. In general, the
+1
src/libunwind-darwin/unwind-pe.h
··· 28 28 29 29 #ifndef GCC_UNWIND_PE_H 30 30 #define GCC_UNWIND_PE_H 31 + #include "unwind-generic.h" 31 32 32 33 /* If using C++, references to abort have to be qualified with std::. */ 33 34 #if __cplusplus
+2 -2
src/util/log.h
··· 37 37 #define FLAGS_LOG 1 38 38 39 39 #ifdef NOLOG 40 - # define LOG if (0) cout 40 + # define LOG if (0) std::cout 41 41 # define LOGF(...) if (0) fprintf(stderr, __VA_ARGS__) 42 42 #else 43 - # define LOG if (FLAGS_LOG) cerr 43 + # define LOG if (FLAGS_LOG) std::cerr 44 44 # define LOGF(...) if (FLAGS_LOG) fprintf(stderr, __VA_ARGS__) 45 45 #endif 46 46
+1 -1
src/util/mutex.h
··· 11 11 public: 12 12 Mutex() 13 13 { 14 - pthread_mutex_init(&m_mutex); 14 + pthread_mutex_init(&m_mutex, 0); 15 15 } 16 16 ~Mutex() 17 17 {