Changeset 1643 for zzuf


Ignore:
Timestamp:
Jan 10, 2007, 6:23:23 PM (13 years ago)
Author:
Sam Hocevar
Message:
  • Check for memalign and posix_memalign.
Location:
zzuf/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/configure.ac

    r1642 r1643  
    1616
    1717AC_CHECK_HEADERS(inttypes.h stdint.h getopt.h libc.h malloc.h)
    18 AC_CHECK_FUNCS(open64 lseek64 mmap64 fopen64 fseeko _IO_getc getline getdelim __getdelim fgetln __srefill map_fd)
     18AC_CHECK_FUNCS(open64 lseek64 mmap64 fopen64 fseeko _IO_getc getline getdelim __getdelim fgetln __srefill map_fd memalign posix_memalign)
    1919AC_CHECK_TYPES(sighandler_t, [], [],
    2020  [#define _GNU_SOURCE
  • 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.