VirtualBox

Changeset 40943 in vbox


Ignore:
Timestamp:
Apr 16, 2012 3:26:45 PM (13 years ago)
Author:
vboxsync
Message:

better fix for the NULL problem

File:
1 edited

Legend:

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

    r40942 r40943  
    126126#   define __inline __inline
    127127#  endif
    128 #  if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
    129  undef __KERNEL__
    130     /**
    131      * linux 3.4-rc3 unconditionally defines NULL as ((void *)0)
    132      * don't let it break our build
     128#  include <linux/types.h>
     129include <linux/stddef.h>
     130    /*
     131     * Starting with 3.4, <linux/stddef.h> defines NULL as '((void*)0)' which
     132     * does not work for C++ code.
    133133     */
    134  include <linux/stddef.h>
    135  define __KERNEL__
    136 #   include <linux/types.h>
     134undef NULL
     135if defined(__cplusplus)
     136#   define NULL 0
    137137#  else
    138 #   include <linux/types.h>
    139 #   include <linux/stddef.h>
     138#   define NULL ((void *)0)
    140139#  endif
    141140#  undef uintptr_t
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