This commit is contained in:
Scott E. Graves 2024-06-03 14:41:00 -05:00
parent 9cb9e6e968
commit 58419fd545
10 changed files with 40 additions and 21 deletions

View File

@ -1,6 +1,9 @@
bdiff bdiff
cmake_current_source_dir cmake_current_source_dir
dhave_unistd_h
dhave_unistd_h
fpatch fpatch
have_unistd_h
intdiff intdiff
intdifftest intdifftest
kubo kubo

View File

@ -6,11 +6,18 @@ project(
VERSION 1.21 VERSION 1.21
) )
include(CheckIncludeFile)
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
check_include_file(unistd.h HAVE_UNISTD_H)
if(HAVE_UNISTD_H)
add_definitions(-DHAVE_UNISTD_H)
endif()
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include) include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include)
option(DTL_ENABLE_TESTING "Enable DTL unit tests" OFF) option(DTL_ENABLE_TESTING "Enable DTL unit tests" OFF)

View File

@ -1,6 +1,19 @@
#ifndef DTL_EXAMPLE_COMMON_H #ifndef DTL_EXAMPLE_COMMON_H
#define DTL_EXAMPLE_COMMON_H #define DTL_EXAMPLE_COMMON_H
#include <cassert>
#include <cstdio>
#include <fstream>
#include <sstream>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif // HAVE_UNISTD_H
#include "dtl/dtl.hpp" #include "dtl/dtl.hpp"
bool isFileExist(std::string &fs); bool isFileExist(std::string &fs);

View File

@ -38,7 +38,6 @@
#ifndef DTL_LCS_H #ifndef DTL_LCS_H
#define DTL_LCS_H #define DTL_LCS_H
#include "dtl/variables.hpp"
#include "dtl/Sequence.hpp" #include "dtl/Sequence.hpp"
namespace dtl { namespace dtl {

View File

@ -38,8 +38,9 @@
#ifndef DTL_SEQUENCE_H #ifndef DTL_SEQUENCE_H
#define DTL_SEQUENCE_H #define DTL_SEQUENCE_H
namespace dtl { #include <vector>
namespace dtl {
/** /**
* sequence class template * sequence class template
*/ */

View File

@ -38,6 +38,9 @@
#ifndef DTL_SES_H #ifndef DTL_SES_H
#define DTL_SES_H #define DTL_SES_H
#include <utility>
#include <vector>
#include "dtl/variables.hpp" #include "dtl/variables.hpp"
#include "dtl/Sequence.hpp" #include "dtl/Sequence.hpp"
@ -48,7 +51,7 @@ namespace dtl {
*/ */
template <typename elem> class Ses : public Sequence<elem> { template <typename elem> class Ses : public Sequence<elem> {
private: private:
typedef pair<elem, elemInfo> sesElem; typedef std::pair<elem, elemInfo> sesElem;
typedef std::vector<sesElem> sesElemVec; typedef std::vector<sesElem> sesElemVec;
public: public:

View File

@ -36,24 +36,6 @@
#ifndef DTL_H #ifndef DTL_H
#define DTL_H #define DTL_H
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <list>
#include <sstream>
#include <string>
#include <vector>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif // HAVE_UNISTD_H
#include "dtl/Diff.hpp" #include "dtl/Diff.hpp"
#include "dtl/Diff3.hpp" #include "dtl/Diff3.hpp"
#include "dtl/Lcs.hpp" #include "dtl/Lcs.hpp"

View File

@ -38,6 +38,8 @@
#ifndef DTL_FUNCTORS_H #ifndef DTL_FUNCTORS_H
#define DTL_FUNCTORS_H #define DTL_FUNCTORS_H
#include <iostream>
#include "dtl/variables.hpp" #include "dtl/variables.hpp"
namespace dtl { namespace dtl {

View File

@ -38,6 +38,12 @@
#ifndef DTL_VARIABLES_H #ifndef DTL_VARIABLES_H
#define DTL_VARIABLES_H #define DTL_VARIABLES_H
#include <algorithm>
#include <iostream>
#include <list>
#include <string>
#include <vector>
namespace dtl { namespace dtl {
using std::cout; using std::cout;

View File

@ -1,6 +1,9 @@
#ifndef DTL_TEST_COMMON #ifndef DTL_TEST_COMMON
#define DTL_TEST_COMMON #define DTL_TEST_COMMON
#include <cstdio>
#include <fstream>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "dtl/dtl.hpp" #include "dtl/dtl.hpp"