Browse Source

Moved os specific includes into OsDetection.h

tempestpy_adaptions
PBerger 12 years ago
parent
commit
01ea2c8427
  1. 7
      src/parser/LabParser.cpp
  2. 9
      src/parser/Parser.cpp
  3. 7
      src/parser/Parser.h
  4. 4
      src/parser/TraParser.cpp
  5. 1
      src/parser/TraParser.h
  6. 3
      src/utility/OsDetection.h

7
src/parser/LabParser.cpp

@ -10,6 +10,7 @@
#include "src/exceptions/WrongFileFormatException.h" #include "src/exceptions/WrongFileFormatException.h"
#include "src/exceptions/FileIoException.h" #include "src/exceptions/FileIoException.h"
#include "src/utility/OsDetection.h"
#include <cstdlib> #include <cstdlib>
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
@ -21,12 +22,6 @@
#include <fcntl.h> #include <fcntl.h>
#include <locale.h> #include <locale.h>
#if defined LINUX || defined MACOSX
#include <sys/mman.h>
#elif defined WINDOWS
#define strncpy strncpy_s
#endif
#include "log4cplus/logger.h" #include "log4cplus/logger.h"
#include "log4cplus/loggingmacros.h" #include "log4cplus/loggingmacros.h"
extern log4cplus::Logger logger; extern log4cplus::Logger logger;

9
src/parser/Parser.cpp

@ -1,14 +1,5 @@
#include "src/parser/Parser.h" #include "src/parser/Parser.h"
#if defined LINUX || defined MACOSX
# include <sys/mman.h>
# include <unistd.h>
#elif defined WINDOWS
#endif
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <iostream> #include <iostream>
#include <cstring> #include <cstring>

7
src/parser/Parser.h

@ -10,13 +10,6 @@
#include "src/utility/OsDetection.h" #include "src/utility/OsDetection.h"
#if defined LINUX || defined MACOSX
# include <sys/mman.h>
#elif defined WINDOWS
# include <Windows.h>
# include <winnt.h>
#endif
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>

4
src/parser/TraParser.cpp

@ -17,10 +17,6 @@
#include <errno.h> #include <errno.h>
#include <time.h> #include <time.h>
#include <sys/stat.h> #include <sys/stat.h>
#if defined LINUX || defined MACOSX
#include <sys/mman.h>
#elif defined WINDOWS
#endif
#include <fcntl.h> #include <fcntl.h>
#include <locale.h> #include <locale.h>

1
src/parser/TraParser.h

@ -4,6 +4,7 @@
#include "src/storage/SquareSparseMatrix.h" #include "src/storage/SquareSparseMatrix.h"
#include "src/parser/Parser.h" #include "src/parser/Parser.h"
#include "src/utility/OsDetection.h"
#include <memory> #include <memory>

3
src/utility/OsDetection.h

@ -6,11 +6,14 @@
#elif defined TARGET_OS_MAC || defined __apple__ || defined __APPLE__ #elif defined TARGET_OS_MAC || defined __apple__ || defined __APPLE__
# define MACOSX # define MACOSX
# define _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE
# include <sys/mman.h>
# include <unistd.h>
#elif defined _WIN32 || defined _WIN64 #elif defined _WIN32 || defined _WIN64
# define WINDOWS # define WINDOWS
# define NOMINMAX # define NOMINMAX
# include <Windows.h> # include <Windows.h>
# include <winnt.h> # include <winnt.h>
# define strncpy strncpy_s
#else #else
# error Could not detect Operating System # error Could not detect Operating System
#endif #endif

Loading…
Cancel
Save