VirtualBox

Changeset 3625 in vbox for trunk/include


Ignore:
Timestamp:
Jul 16, 2007 2:29:43 AM (17 years ago)
Author:
vboxsync
Message:

FreeBSD kernel.

File:
1 edited

Legend:

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

    r3549 r3625  
    3030#ifndef IPRT_NO_CRT
    3131
    32 # if !defined(__DARWIN__) || !defined(KERNEL)   /* Klugde for the darwin kernel. */
    33 #  include <stddef.h>
    34 # else /* DARWIN && KERNEL */
     32# if defined(__DARWIN__) && defined(KERNEL)
     33    /*
     34     * Klugde for the darwin kernel:
     35     *  stddef.h is missing IIRC.
     36     */
    3537#  ifndef _PTRDIFF_T
    3638#  define _PTRDIFF_T
    3739    typedef __darwin_ptrdiff_t ptrdiff_t;
    3840#  endif
    39 # endif /* DARWIN && KERNEL */
    40 
    41 # if defined(__LINUX__) && defined(__KERNEL__)
     41#  include <sys/types.h>
     42
     43# elif defined(__FREEBSD__) && defined(_KERNEL)
     44    /*
     45     * Kludge for the FreeBSD kernel:
     46     *  stddef.h and sys/types.h has sligtly different offsetof definitions
     47     *  when compiling in kernel mode. This is just to make GCC keep shut.
     48     */
     49#  ifndef _STDDEF_H_
     50#   undef offsetof
     51#  endif
     52#  include <stddef.h>
     53#  ifndef _SYS_TYPES_H_
     54#   undef offsetof
     55#  endif
     56#  include <sys/types.h>
     57#  ifndef offsetof
     58#   error "offsetof is not defined..."
     59#  endif
     60
     61# elif defined(__LINUX__) && defined(__KERNEL__)
    4262    /*
    4363     * Kludge for the linux kernel:
     
    4767     * We work around these issues here and nowhere else.
    4868     */
     69#  include <stddef.h>
    4970#  if defined(__cplusplus)
    5071    typedef bool _Bool;
     
    5879#  undef true
    5980#  undef bool
     81
    6082# else
     83#  include <stddef.h>
    6184#  include <sys/types.h>
    6285# endif
     
    6790   typedef intptr_t ssize_t;
    6891# endif
     92
    6993#else /* no crt */
    7094# include <iprt/nocrt/compiler/gcc.h>
Note: See TracChangeset for help on using the changeset viewer.

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