Changeset 1643 for zzuf/trunk/src


Ignore:
Timestamp:
Jan 10, 2007, 6:23:23 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Check for memalign and posix_memalign.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/src/load-mem.c

    r1642 r1643  
    2424#define _LARGEFILE64_SOURCE
    2525/* Use this to get posix_memalign */
    26 #define _XOPEN_SOURCE 600
     26#if defined HAVE_POSIX_MEMALIGN
     27#   define _XOPEN_SOURCE 600
     28#endif
    2729
    2830#if defined HAVE_STDINT_H
     
    5759static void    (*free_orig)     (void *ptr);
    5860static void *  (*valloc_orig)   (size_t size);
     61#ifdef HAVE_MEMALIGN
    5962static void *  (*memalign_orig) (size_t boundary, size_t size);
     63#endif
     64#ifdef HAVE_POSIX_MEMALIGN
    6065static int     (*posix_memalign_orig) (void **memptr, size_t alignment,
    6166                                       size_t size);
     67#endif
    6268static void *  (*realloc_orig)  (void *ptr, size_t size);
    6369static int     (*brk_orig)      (void *end_data_segment);
     
    8793    LOADSYM(realloc);
    8894    LOADSYM(valloc);
     95#ifdef HAVE_MEMALIGN
    8996    LOADSYM(memalign);
     97#endif
     98#ifdef HAVE_POSIX_MEMALIGN
    9099    LOADSYM(posix_memalign);
     100#endif
    91101    LOADSYM(brk);
    92102    LOADSYM(sbrk);
     
    167177}
    168178
     179#ifdef HAVE_MEMALIGN
    169180void *memalign(size_t boundary, size_t size)
    170181{
     
    177188    return ret;
    178189}
    179 
     190#endif
     191
     192#ifdef HAVE_POSIX_MEMALIGN
    180193int posix_memalign(void **memptr, size_t alignment, size_t size)
    181194{
     
    188201    return ret;
    189202}
     203#endif
    190204
    191205int brk(void *end_data_segment)
Note: See TracChangeset for help on using the changeset viewer.