Skip to content

Commit

Permalink
move cpp17 fix to a patch
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyMlashkin committed Jun 10, 2021
1 parent 82f7897 commit 1dea41d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
6 changes: 1 addition & 5 deletions recipes/gperf/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class GperfConan(ConanFile):
settings = "os", "arch", "compiler"
_source_subfolder = "source_subfolder"
_autotools = None
exports_sources = "patches/**"

@property
def _is_msvc(self):
Expand Down Expand Up @@ -59,11 +60,6 @@ def _build_configure(self):
autotools.make()

def build(self):
if tools.valid_min_cppstd(self, "17"):
tools.replace_in_file(os.path.join(self._source_subfolder, "lib", "getline.cc"),
"register int c = getc (stream);",
"int c = getc (stream);")

if self._is_msvc:
with tools.vcvars(self.settings):
self._build_configure()
Expand Down
13 changes: 13 additions & 0 deletions recipes/gperf/all/patches/remove-register-keyword.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/lib/getline.cc b/lib/getline.cc
index ecc3e85..2d97644 100644 (file)
--- a/lib/getline.cc
+++ b/lib/getline.cc
@@ -55,7 +55,7 @@ getstr (char **lineptr, size_t *n, FILE *stream, char terminator, size_t offset)

for (;;)
{
- register int c = getc (stream);
+ int c = getc (stream);

/* We always want at least one char left in the buffer, since we
always (unless we get an error while reading the first char)

0 comments on commit 1dea41d

Please sign in to comment.