mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	Serialize FS service; some compiler fixes
This commit is contained in:
		
							parent
							
								
									d1096de245
								
							
						
					
					
						commit
						3ed8d95866
					
				
					 10 changed files with 62 additions and 45 deletions
				
			
		|  | @ -18,18 +18,17 @@ | |||
| // Boost::serialization doesn't like union types for some reason,
 | ||||
| // so we need to mark arrays of union values with a special serialization method
 | ||||
| template<typename Value, size_t Size> | ||||
| struct UnionArray : public std::array<Value, Size> { }; | ||||
| 
 | ||||
| namespace boost::serialization { | ||||
| 
 | ||||
| template<class Archive, typename Value, size_t Size> | ||||
| void serialize(Archive& ar, UnionArray<Value, Size>& array, const unsigned int version) | ||||
| struct UnionArray : public std::array<Value, Size> | ||||
| { | ||||
|     static_assert(sizeof(Value) == sizeof(u32)); | ||||
|     ar & *static_cast<u32 (*)[Size]>(static_cast<void *>(array.data())); | ||||
| } | ||||
| 
 | ||||
| } | ||||
| private: | ||||
|     template<class Archive> | ||||
|     void serialize(Archive& ar, const unsigned int) | ||||
|     { | ||||
|         static_assert(sizeof(Value) == sizeof(u32)); | ||||
|         ar & *static_cast<u32 (*)[Size]>(static_cast<void *>(this->data())); | ||||
|     } | ||||
|     friend class boost::serialization::access; | ||||
| }; | ||||
| 
 | ||||
| namespace Pica { | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue