Skip to content

Instantly share code, notes, and snippets.

@zygoloid
Created June 8, 2020 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zygoloid/79a73aca12c574d1e532c2af185f1c6c to your computer and use it in GitHub Desktop.
Save zygoloid/79a73aca12c574d1e532c2af185f1c6c to your computer and use it in GitHub Desktop.
Diffs to build bobcat with Clang + libc++ + C++20
diff --git a/bobcat/INSTALL.im b/bobcat/INSTALL.im
index 49fda306..220629da 100644
--- a/bobcat/INSTALL.im
+++ b/bobcat/INSTALL.im
@@ -17,13 +17,14 @@
//===========================================================================
// The name of the C++ compiler
-#define CXX "g++"
+#define CXX "/home/richardsmith/clang-mono-1/build-opt/bin/clang++"
// Specify compiler options that should be used.
// This is overruled by the environment variable CXXFLAGS
// The options "-isystem tmp" must always be used, are set in
// icmake/library and should not be altered.
-#define CXXFLAGS "--std=c++2a -O2 -Wall -fdiagnostics-color=never"
+#define CXXFLAGS "-std=c++2a -O2 -Wall -stdlib=libc++ -fmodules"
+//#define CXXFLAGS "-std=c++2a -O2 -Wall -stdlib=libc++"
// Classes requiring the -pthread compiler option
#define PTHREAD "sharedmutex sharedblock sharedmemory sharedsegment " \
@@ -67,14 +68,14 @@
// DOC is the directory in which development- related documentation is
// stored (various README files, examples, html-man-pages)
-#define DOC "/usr/share/doc/libbobcat5-dev"
+#define DOC "/home/richardsmith/tmp/bisoncpp/install/usr/share/doc/libbobcat5-dev"
// HDR is the directory in which the header files are stored
-#define HDR "/usr/include/bobcat"
+#define HDR "/home/richardsmith/tmp/bisoncpp/install/usr/include/bobcat"
// LIB is the directory in which the bobcat libraries will be stored
-#define LIB "/usr/lib"
+#define LIB "/home/richardsmith/tmp/bisoncpp/install/usr/lib"
// MAN is the directory in which the manual pages are stored
// They are stored below MAN in subdirectories man3 and man7
-#define MAN "/usr/share/man"
+#define MAN "/home/richardsmith/tmp/bisoncpp/install/usr/share/man"
diff --git a/bobcat/arg/firstnonempty.cc b/bobcat/arg/firstnonempty.cc
index dc072441..2c998be9 100644
--- a/bobcat/arg/firstnonempty.cc
+++ b/bobcat/arg/firstnonempty.cc
@@ -4,7 +4,7 @@ size_t Arg__::firstNonEmpty(size_t *idx, string *value,
StringVector const &sv) const
{
StringVector::const_iterator sit = find_if(sv.begin(), sv.end(),
- bind2nd(not_equal_to<string>(), ""));
+ std::bind(not_equal_to<string>(), "", std::placeholders::_1));
if (sit == sv.end())
*idx = sv.size();
else
diff --git a/bobcat/build b/bobcat/build
index 5577cf30..27f9f08f 100755
--- a/bobcat/build
+++ b/bobcat/build
@@ -1,4 +1,4 @@
-#!/usr/bin/icmake -qt/tmp/bobcat
+#!/home/richardsmith/tmp/bisoncpp/install/usr/bin/icmake -qt/tmp/bobcat
#include "INSTALL.im"
diff --git a/bobcat/ifilterbuf/pbackfail.cc b/bobcat/ifilterbuf/pbackfail.cc
index 3807337a..73c3fedb 100644
--- a/bobcat/ifilterbuf/pbackfail.cc
+++ b/bobcat/ifilterbuf/pbackfail.cc
@@ -5,7 +5,7 @@ int IFilterBuf::pbackfail(int ch)
if (bufSize() == d_maxSize) // the buffer is at its
return EOF; // max. size: no extensions
- buffer().insert(0, 1, ch); // insert ch at the front
+ buffer().insert((size_t)0, (size_t)1, (char)ch); // insert ch at the front
setg(0, bufSize()); // start reading from the
// beginning
diff --git a/bobcat/localserversocket/open.cc b/bobcat/localserversocket/open.cc
index c9bb8997..bf54e470 100644
--- a/bobcat/localserversocket/open.cc
+++ b/bobcat/localserversocket/open.cc
@@ -6,7 +6,7 @@ void LocalServerSocket::open(string const &name, Socket action)
d_unlink = action == UNLINK;
d_name = name;
- if (bind(socket(), sockaddrPtr(), size()) < 0)
+ if (::bind(socket(), sockaddrPtr(), size()) < 0)
throw Exception{} << "LocalServerSocket::open(" << name << "): " <<
errnodescr;
}
diff --git a/bobcat/processenums/processenums b/bobcat/processenums/processenums
index 69c5e449..fc9d3e27 100644
--- a/bobcat/processenums/processenums
+++ b/bobcat/processenums/processenums
@@ -1,6 +1,7 @@
#ifndef INCLUDED_BOBCAT_PROCESSENUMS_
#define INCLUDED_BOBCAT_PROCESSENUMS_
+#include <stddef.h>
namespace FBB
{
diff --git a/bobcat/randbuf/driver/driver.h b/bobcat/randbuf/driver/driver.h
index 188bc462..7bad0571 100644
--- a/bobcat/randbuf/driver/driver.h
+++ b/bobcat/randbuf/driver/driver.h
@@ -1,7 +1,7 @@
// driver.h
-#ifndefH_driver_
-#defineH_driver_
+#ifndef H_driver_
+#define H_driver_
/*
$Id$
diff --git a/bobcat/serversocket/serversocket1.cc b/bobcat/serversocket/serversocket1.cc
index 22557a3c..4dfa085a 100644
--- a/bobcat/serversocket/serversocket1.cc
+++ b/bobcat/serversocket/serversocket1.cc
@@ -13,6 +13,6 @@ ServerSocket::ServerSocket(size_t port)
return;
}
- if (bind(socket(), sockaddrPtr(), size()) < 0)
+ if (::bind(socket(), sockaddrPtr(), size()) < 0)
d_msg = "ServerSocket::ServerSocket(port)";
}
diff --git a/bobcat/sharedsegment/sharedsegment b/bobcat/sharedsegment/sharedsegment
index e481c6d9..a42f7f24 100644
--- a/bobcat/sharedsegment/sharedsegment
+++ b/bobcat/sharedsegment/sharedsegment
@@ -2,6 +2,7 @@
#define INCLUDED_BOBCAT_SHAREDSEGMENT_
#include <iosfwd>
+#include <ios>
#include <bobcat/sharedblock>
diff --git a/bobcat/string/string b/bobcat/string/string
index bc9570cd..d15a98cb 100644
--- a/bobcat/string/string
+++ b/bobcat/string/string
@@ -7,6 +7,7 @@
#include <string>
#include <vector>
+
namespace FBB
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment