include fixes to make it compile on osx, added *~ files to gitignore

This commit is contained in:
Pawel "l0ner" Soltys 2015-01-04 17:21:20 +01:00
parent 2040736dd6
commit 47b9f62a10
4 changed files with 10 additions and 3 deletions

3
.gitignore vendored

@ -7,6 +7,7 @@
*.o *.o
*.so *.so
sysstat sysstat
tmux-mem-cpu-load
# CMake generated # # CMake generated #
################### ###################
@ -17,7 +18,6 @@ CMakeCache.txt
install_manifest.txt install_manifest.txt
version.h version.h
CTestTestfile.cmake CTestTestfile.cmake
tmux-mem-cpu-load
DartConfiguration.tcl DartConfiguration.tcl
# Packages # # Packages #
@ -49,3 +49,4 @@ ehthumbs.db
Thumbs.db Thumbs.db
*.swp *.swp
*.swo *.swo
*~

@ -10,6 +10,8 @@
#include <sys/sysctl.h> // for sysctl #include <sys/sysctl.h> // for sysctl
#include <sys/types.h> // for integer types #include <sys/types.h> // for integer types
#include <unistd.h> // usleep()
// OSX or BSD based system, use BSD APIs instead // OSX or BSD based system, use BSD APIs instead
// See: http://www.opensource.apple.com/source/xnu/xnu-201/osfmk/mach/host_info.h // See: http://www.opensource.apple.com/source/xnu/xnu-201/osfmk/mach/host_info.h
// and: http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/ // and: http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/

@ -1,10 +1,13 @@
#include <string> #include <string>
#include <sstream> #include <sstream>
#include <fstream> #include <fstream>
#include <cmath> // floorf()
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> // getloadavg() #include <stdlib.h> // getloadavg()
#include "../luts.h"
std::string load_string( bool use_colors = false ) { std::string load_string( bool use_colors = false ) {
std::ostringstream oss; std::ostringstream oss;

@ -1,6 +1,5 @@
#include <string> #include <string>
#include <sstring> #include <sstream>
#include <fstring>
#include <mach/vm_statistics.h> #include <mach/vm_statistics.h>
#include <mach/processor_info.h> #include <mach/processor_info.h>
@ -14,6 +13,8 @@
#include <sys/sysctl.h> // for sysctl #include <sys/sysctl.h> // for sysctl
#include <sys/types.h> // for integer types #include <sys/types.h> // for integer types
#include "../luts.h"
std::string mem_string( bool use_colors ) { std::string mem_string( bool use_colors ) {
std::ostringstream oss; std::ostringstream oss;