GithubHelp home page GithubHelp logo

Comments (5)

cfpp2p avatar cfpp2p commented on September 20, 2024

cfpp2p@39d0263

from libutp.

ghazel avatar ghazel commented on September 20, 2024

bool is defined (conditionally) in utypes.h not utp.h. So that's one thing to address first.

Next, what is __bool_true_false_are_defined? Finally, utp.cpp itself is C++ obviously, so there's no pressing need to define true and false in the header.

from libutp.

jordanl avatar jordanl commented on September 20, 2024

__bool_true_false_are_defined is a macro from stdbool.h to detect whether those keywords have already been defined.

The issue is that the compiler isn't smart enough to understand that the different typedefs from utypes.h, stdbool.h, and elsewhere are really the same unsigned char, so compilation fails with a mismatch.

Including stdbool.h in the not-C++ block of utypes.h would fix this. I don't know how universal stdbool.h is on your target platforms, but you could possibly drop the HAVE_STDBOOL_H autoconf idiom.

from libutp.

ghazel avatar ghazel commented on September 20, 2024

Certainly there is no stdbool.h on Windows. Also we don't have autoconf to set HAVE_STDBOOL_H.

Any easy answer here would be just use ints. That seems unlikely to bite me again (#12).

Why does the state of C89/C99/C++ have to be so terrible?

from libutp.

jordanl avatar jordanl commented on September 20, 2024

Blah, I forgot about #12.

int sounds like it might be the least-bad choice.

from libutp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.