wuzhipeng2014 / freenos

Automatically exported from code.google.com/p/freenos
GNU General Public License v3.0
0 stars 0 forks source link

SCons should check for the type of size_t for operators new() and delete() #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
On some host systems, like for example OpenBSD, the type of a size_t is an
long unsigned int. When
implementing the new() operator, the type of a size_t should be correct, as
GCC will
throw an error otherwise:

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
CXX lib/liballoc/Allocator.o
In file included from lib/liballoc/Allocator.cpp:19:
lib/liballoc/Allocator.h:122: error: 'operator new' takes type 'size_t'
('long unsigned int') as first parameter

Original issue reported on code.google.com by coenbijlsma on 7 Aug 2009 at 10:19

GoogleCodeExporter commented 9 years ago
ORIGINAL COMMENT FROM nieklinnenbank
On OpenBSD, GCC defines the following C preprocessor macro, which may
be very useful in solving this problem:

#define __SIZE_TYPE__ long unsigned int

Original comment by coenbijlsma on 7 Aug 2009 at 10:19