Further FreeBSD compile fixes, thanks tolmaion
This commit is contained in:
		
							parent
							
								
									816657347f
								
							
						
					
					
						commit
						0c4c1ce878
					
				| @ -21,8 +21,9 @@ | |||||||
| #ifndef MACHINE_INFO_H | #ifndef MACHINE_INFO_H | ||||||
| #define MACHINE_INFO_H | #define MACHINE_INFO_H | ||||||
| 
 | 
 | ||||||
| #ifdef __APPLE__ | #if defined(__APPLE__) || defined(__FreeBSD__) | ||||||
| extern "C" { | extern "C" { | ||||||
|  | #include <sys/types.h> | ||||||
| #include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||||
| }	 | }	 | ||||||
| #endif | #endif | ||||||
| @ -39,6 +40,13 @@ unsigned GetPhysicalmemory(void){ | |||||||
| 	sysctl(mib, 2, &memsize, &len, NULL, 0); | 	sysctl(mib, 2, &memsize, &len, NULL, 0); | ||||||
| 	return memsize/1024; | 	return memsize/1024; | ||||||
| 	 | 	 | ||||||
|  | #elif defined(__FreeBSD__) | ||||||
|  | 	int mib[2] = {CTL_HW, HW_PHYSMEM}; | ||||||
|  | 	long long memsize; | ||||||
|  | 	size_t len = sizeof(memsize); | ||||||
|  | 	sysctl(mib, 2, &memsize, &len, NULL, 0); | ||||||
|  | 	return memsize/1024; | ||||||
|  | 	 | ||||||
| #else | #else | ||||||
| 	std::cout << "[Warning] Compiling on unknown architecture." << std::endl  | 	std::cout << "[Warning] Compiling on unknown architecture." << std::endl  | ||||||
| 		<< "Please file a ticket at http://project-osrm.org" << std::endl; | 		<< "Please file a ticket at http://project-osrm.org" << std::endl; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user