Ignore:
Timestamp:
Mar 10, 2014, 9:55:33 PM (7 years ago)
Author:
cal@…
Message:

darwintrace: use modern interposing, avoid DYLD_FORCE_FLAT_NAMESPACE that's no longer necessary with interposing, #29228, patch by gauravb7090

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/darwintracelib1.0/darwintrace.h

    r114131 r117751  
    4343#include <stdbool.h>
    4444#include <stdio.h>
     45
     46/**
     47 * DARWINTRACE_INTERPOSE: provides a way to override standard library functions
     48 * with your own implementations.
     49 */
     50#ifndef DARWINTRACE_INTERPOSE
     51#define DARWINTRACE_INTERPOSE(_replacement, _replacee) \
     52__attribute__((used)) static struct { \
     53        const void *replacement; \
     54        const void *replacee; \
     55} _interpose_##_replacee \
     56__attribute__((section ("__DATA,__interpose"))) = { \
     57        (const void *) (unsigned long) &_replacement, \
     58        (const void *) (unsigned long) &_replacee \
     59}
     60#endif
    4561
    4662/**
Note: See TracChangeset for help on using the changeset viewer.