mirror of
				https://github.com/Zygo/bees.git
				synced 2025-10-31 02:00:34 +01:00 
			
		
		
		
	I accidentally did a pre-push verification on a 32-bit build host. There were a surprisingly small number of problems, so fix them. Bees now builds on a 32-bit host. Let's not update README just yet, though: the 32-bit ioctl support fails immediately after startup on a 64-bit kernel.
		
			
				
	
	
		
			29 lines
		
	
	
		
			679 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			679 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #ifndef CRUCIBLE_NTOA_H
 | |
| #define CRUCIBLE_NTOA_H
 | |
| 
 | |
| #include <string>
 | |
| 
 | |
| namespace crucible {
 | |
| 	using namespace std;
 | |
| 
 | |
| 	struct bits_ntoa_table {
 | |
| 		unsigned long long n;
 | |
| 		unsigned long long mask;
 | |
| 		const char *a;
 | |
| 	};
 | |
| 
 | |
| 	string bits_ntoa(unsigned long long n, const bits_ntoa_table *a);
 | |
| 
 | |
| };
 | |
| 
 | |
| // Combinations of bits (list multiple-bit entries first)
 | |
| #define NTOA_TABLE_ENTRY_BITS(x) { .n = (x), .mask = (x), .a = (#x) }
 | |
| 
 | |
| // Enumerations (entire value matches all bits)
 | |
| #define NTOA_TABLE_ENTRY_ENUM(x) { .n = (x), .mask = ~0UL,  .a = (#x) }
 | |
| 
 | |
| // End of table (sorry, gcc doesn't implement this)
 | |
| #define NTOA_TABLE_ENTRY_END() { .n = 0, .mask = 0, .a = nullptr }
 | |
| 
 | |
| #endif // CRUCIBLE_NTOA_H
 |