SWIG typedef failue on 32-bit machines
|Assignee:||Tom Rondeau||% Done:||
As lately as commit b7a5f16f, GNU Radio does not build on 32-bit machines.
The problem is related to SWIG's handling (or mishandling) of size_t. The vector_map block uses vector<vector<size_t>>> in it's arguments and so tells SWIG about this. SWIG seems to cast this 'unsigned long' on 64-bit machines and 'unsigned int' on 32-bit machines.
In gr_block.i, we use vector<unsigned int> to pass in the processor mask to the set_processor_affinity call. We then must tell SWIG about vector<unsigned int>. On 64-bit machines this works because above is sees size_t as an unsigned long. But on 32-bit machines, SWIG thinks we are redefining the typedef for vector<unsigned int>.
While it may be possible to get these concepts to work together, I cannot figure out how to fix this so that both 32-bit and 64-bit machines compile.
The proposed fix is to use ints instead of unsigned ints in the processor affinity mask's vectors (i.e., vector<int> instead of vector<unsigned int>). This is wrong as these values should be unsigned, but I feel that it is better to do this than change the use of size_t. This, of course, limits us to only being able to address somewhere just over 2 billion processors, which I'm ok with for now. Though the conversion to the processor mask underneath might handle the conversion if negative numbers are used.
Updated by Tom Rondeau 9 months ago
- Resolution set to fixed
This proposed fix was applied in commit:
This should do for now.