VirtualBox

Changeset 31843 in vbox for trunk/include


Ignore:
Timestamp:
Aug 21, 2010 7:02:44 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
65045
Message:

FreeBSD: build fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/string.h

    r31419 r31843  
    3535# include <linux/string.h>
    3636#elif defined(RT_OS_FREEBSD) && defined(_KERNEL)
     37/**
     38 * XXX: Very ugly hack to get things build on recent FreeBSD
     39 * builds. They have memchr now and we need to include
     40 * param.h to get __FreeBSD_version and make
     41 * memchr available based on the version below
     42 * or we can't compile the kernel module on
     43 * older versions anymore.
     44 *
     45 * But including param.h here opens Pandora's box
     46 * because we clash with a few defines
     47 * namely PVM and PAGE_SIZE.
     48 * We can safely undefine PVM here but not PAGE_SIZE
     49 * because this results in build errors sooner or later.
     50 * Luckily this define is in a header included by param.h
     51 * (machine/param.h). We define the guards here
     52 * to prevent inclusion of it if PAGE_SIZE
     53 * was defined already.
     54 *
     55 * @todo r=aeichner: Search for an elegant solution
     56 *                   and cleanup this mess ASAP!
     57 */
     58# ifdef PAGE_SIZE
     59#  define _AMD64_INCLUDE_PARAM_H_
     60#  define _I386_INCLUDE_PARAM_H_
     61# endif
     62# include <sys/param.h> /* __FreeBSD_version */
     63# undef PVM
    3764# include <sys/libkern.h>
    3865  /*
     
    5986 * IPRT instead of the operating environment.
    6087 */
    61 #if    (defined(RT_OS_DARWIN) && defined(KERNEL)) \
    62     || (defined(RT_OS_FREEBSD) && defined(_KERNEL))
     88#if defined(RT_OS_DARWIN) && defined(KERNEL)
    6389RT_C_DECLS_BEGIN
    6490void *memchr(const void *pv, int ch, size_t cb);
     
    6793#endif
    6894
     95#if defined(RT_OS_FREEBSD) && defined(_KERNEL)
     96RT_C_DECLS_BEGIN
     97#if __FreeBSD_version < 900000
     98void *memchr(const void *pv, int ch, size_t cb);
     99#endif
     100char *strpbrk(const char *pszStr, const char *pszChars);
     101RT_C_DECLS_END
     102#endif
    69103
    70104/** @def RT_USE_RTC_3629
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette