Re-instate this as an arch-independent package, and remove gcc call
We're now assuming that the size of size_t is a long unsigned integer. In the kernel there's a comment: /* * Most 32 bit architectures use "unsigned int" size_t, * and all 64 bit architectures use "unsigned long" size_t. */ On 32 bit architectures, an unsigned int is the same size as an unsigned long anyway, so I think this assumption is OK.
This commit is contained in:
@@ -82,8 +82,8 @@ class CStruct
|
||||
begin
|
||||
require 'linux/c_struct_sizeof_size_t.rb'
|
||||
rescue LoadError
|
||||
warn "Falling back to gcc to determine sizeof size_t." if $VERBOSE
|
||||
SIZEOF_SIZE_T = Integer(`echo __SIZEOF_SIZE_T__ | gcc -E -P -`) rescue 1.size
|
||||
warn "netlinkrb: Assuming size_t is a long unsigned int." if $DEBUG
|
||||
SIZEOF_SIZE_T = [0].pack("L_").size
|
||||
end
|
||||
|
||||
define_type :size_t,
|
||||
|
Reference in New Issue
Block a user