Skip to content

Oils fails to compile on NetBSD: expected unqualified-id before 'sizeof' #2326

Open
@MarcCoquand

Description

@MarcCoquand

Heya, when trying to compile oils-for-unix on NetBSD, I'm running into a compilation issue:

In file included from cpp/stdlib.cc:9:
cpp/stdlib.cc:25:6 error: expected unqualified-id before 'sizeof'
    25  | bool isinf(double f) {
          |     ^-----
cpp/stdlib.cc:25:6 error: expected ')' before 'sizeof'
cpp/stdlib.cc:25:6 error: expected ')' before 'sizeof'
cpp/stdlib.cc:25:6 error: expected unqualified-id before 'sizeof'
    25  | bool isnan(double f) {
          |      ^-----
cpp/stdlib.cc:25:6 error: expected ')' before 'sizeof'
cpp/stdlib.cc:25:6 error: expected ')' before 'sizeof'

I could get it to compile with the following patch:

--- cpp/stdlib.cc.orig
+++ cpp/stdlib.cc
@@ -22,12 +22,14 @@ using error:e_die;

 namespace match {

+#undef isinf
 bool isinf(double f) {
-  return ::isinf(f);
+  return math::isinf(f);
 }

+#undef isnan
 bool isnan(double f) {
-  return ::isnan(f);
+  return math::isnan(f);
 }

 }  // namespace math

But I don't think this is the correct way to do it, I don't really have the c++ skills to fix this though.

Version: 0.31.0
OS: Netbsd 10.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions