Fix windows compilation with regard to struct/class packing
This commit is contained in:
		
							parent
							
								
									b00b15ab98
								
							
						
					
					
						commit
						2091c3443b
					
				@ -46,28 +46,34 @@ namespace extractor
 | 
			
		||||
namespace lookup
 | 
			
		||||
{
 | 
			
		||||
// Set to 1 byte alignment
 | 
			
		||||
#pragma pack(push, 1)
 | 
			
		||||
struct SegmentHeaderBlock
 | 
			
		||||
{
 | 
			
		||||
    std::uint32_t num_osm_nodes;
 | 
			
		||||
    OSMNodeID previous_osm_node_id;
 | 
			
		||||
} __attribute ((packed));
 | 
			
		||||
};
 | 
			
		||||
#pragma pack(pop)
 | 
			
		||||
static_assert(sizeof(SegmentHeaderBlock) == 12, "SegmentHeaderBlock is not packed correctly");
 | 
			
		||||
 | 
			
		||||
#pragma pack(push, 1)
 | 
			
		||||
struct SegmentBlock
 | 
			
		||||
{
 | 
			
		||||
    OSMNodeID this_osm_node_id;
 | 
			
		||||
    double segment_length;
 | 
			
		||||
    std::int32_t segment_weight;
 | 
			
		||||
} __attribute ((packed));
 | 
			
		||||
};
 | 
			
		||||
#pragma pack(pop)
 | 
			
		||||
static_assert(sizeof(SegmentBlock) == 20, "SegmentBlock is not packed correctly");
 | 
			
		||||
 | 
			
		||||
#pragma pack(push, 1)
 | 
			
		||||
struct PenaltyBlock
 | 
			
		||||
{
 | 
			
		||||
    std::uint32_t fixed_penalty;
 | 
			
		||||
    OSMNodeID from_id;
 | 
			
		||||
    OSMNodeID via_id;
 | 
			
		||||
    OSMNodeID to_id;
 | 
			
		||||
} __attribute ((packed));
 | 
			
		||||
};
 | 
			
		||||
#pragma pack(pop)
 | 
			
		||||
static_assert(sizeof(PenaltyBlock) == 28, "PenaltyBlock is not packed correctly");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user