VirtualBox

Changeset 3092

Show
Ignore:
Timestamp:
06/11/07 16:37:02 (2 years ago)
Author:
vboxsync
Message:

Work in the linux kernel env. too.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/iprt/alloca.h

    r2981 r3092  
    2727 * specific #ifdefs. But for now we'll just include the headers 
    2828 * which normally contains the alloca() prototype. 
     29 * When we're in kernel territory it starts getting a bit more 
     30 * interesting of course... 
    2931 */ 
    30 #include <stdlib.h> 
    31 #if !defined(__DARWIN__) && !defined(__FREEBSD__) 
    32 # include <malloc.h> 
     32#if defined(IN_RING0) && defined(__LINUX__) 
     33/* ASSUMES GNU C */ 
     34# define alloca(cb) __builtin_alloca(cb) 
     35#else 
     36# include <stdlib.h> 
     37# if !defined(__DARWIN__) && !defined(__FREEBSD__) 
     38#  include <malloc.h> 
     39# endif 
     40# ifdef __SOLARIS__ 
     41#  include <alloca.h> 
     42# endif 
    3343#endif 
    34 #ifdef __SOLARIS__ 
    35 # include <alloca.h> 
    36 #endif 
    37  
    3844 
    3945#endif 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy