From 01ea2c8427e9644c6c462c48505b7512c30c44db Mon Sep 17 00:00:00 2001 From: PBerger Date: Mon, 17 Dec 2012 03:25:59 +0100 Subject: [PATCH] Moved os specific includes into OsDetection.h --- src/parser/LabParser.cpp | 7 +------ src/parser/Parser.cpp | 9 --------- src/parser/Parser.h | 7 ------- src/parser/TraParser.cpp | 4 ---- src/parser/TraParser.h | 1 + src/utility/OsDetection.h | 3 +++ 6 files changed, 5 insertions(+), 26 deletions(-) diff --git a/src/parser/LabParser.cpp b/src/parser/LabParser.cpp index 8f0b18117..45274347d 100644 --- a/src/parser/LabParser.cpp +++ b/src/parser/LabParser.cpp @@ -10,6 +10,7 @@ #include "src/exceptions/WrongFileFormatException.h" #include "src/exceptions/FileIoException.h" +#include "src/utility/OsDetection.h" #include #include #include @@ -21,12 +22,6 @@ #include #include -#if defined LINUX || defined MACOSX - #include -#elif defined WINDOWS - #define strncpy strncpy_s -#endif - #include "log4cplus/logger.h" #include "log4cplus/loggingmacros.h" extern log4cplus::Logger logger; diff --git a/src/parser/Parser.cpp b/src/parser/Parser.cpp index aeb43f867..1e25ee404 100644 --- a/src/parser/Parser.cpp +++ b/src/parser/Parser.cpp @@ -1,14 +1,5 @@ #include "src/parser/Parser.h" -#if defined LINUX || defined MACOSX -# include -# include -#elif defined WINDOWS -#endif - -#include -#include -#include #include #include diff --git a/src/parser/Parser.h b/src/parser/Parser.h index 95b6db552..81938ecf7 100644 --- a/src/parser/Parser.h +++ b/src/parser/Parser.h @@ -10,13 +10,6 @@ #include "src/utility/OsDetection.h" -#if defined LINUX || defined MACOSX -# include -#elif defined WINDOWS -# include -# include -#endif - #include #include #include diff --git a/src/parser/TraParser.cpp b/src/parser/TraParser.cpp index 5b98a9dda..7f38187d7 100644 --- a/src/parser/TraParser.cpp +++ b/src/parser/TraParser.cpp @@ -17,10 +17,6 @@ #include #include #include -#if defined LINUX || defined MACOSX - #include -#elif defined WINDOWS -#endif #include #include diff --git a/src/parser/TraParser.h b/src/parser/TraParser.h index 4626fab72..a7079ea66 100644 --- a/src/parser/TraParser.h +++ b/src/parser/TraParser.h @@ -4,6 +4,7 @@ #include "src/storage/SquareSparseMatrix.h" #include "src/parser/Parser.h" +#include "src/utility/OsDetection.h" #include diff --git a/src/utility/OsDetection.h b/src/utility/OsDetection.h index 6cda4c781..af8896adf 100644 --- a/src/utility/OsDetection.h +++ b/src/utility/OsDetection.h @@ -6,11 +6,14 @@ #elif defined TARGET_OS_MAC || defined __apple__ || defined __APPLE__ # define MACOSX # define _DARWIN_USE_64_BIT_INODE +# include +# include #elif defined _WIN32 || defined _WIN64 # define WINDOWS # define NOMINMAX # include # include +# define strncpy strncpy_s #else # error Could not detect Operating System #endif