Coder Social home page Coder Social logo

Comments (5)

Sven-HP avatar Sven-HP commented on May 25, 2024 1

@d99kris If you want to keep your typedef, I suggest to move it into your rapidcsv namespace. That should avoid conflicts with potential typedefs in other headers.

from rapidcsv.

d99kris avatar d99kris commented on May 25, 2024 1

Thanks for checking the PR @Sven-HP!

This issue should be fixed now. Please let me know if you still encounter any issues @p0358. Thanks.

from rapidcsv.

d99kris avatar d99kris commented on May 25, 2024

Hi @p0358 - thanks for reporting the bug. It's an interesting problem! While checking #ifndef ssize_t will work in this particular scenario, I believe it will not work if another header has typedef'ed ssize_t to something else.

Actually ssize_t is mostly used internally in rapidcsv and not exposed much in the public API. I'm wondering if maybe it makes sense to replace it with int64_t to avoid the problem altogether. I'll need to do some research and get back.

from rapidcsv.

d99kris avatar d99kris commented on May 25, 2024

Thanks for the suggestion @Sven-HP - that is true! But I think I'm more inclined to drop the typedef and simply use a standard integer type. I'd prefer if portable apps would not need stuff like rapidcsv::ssize_t x = doc.GetColumnIdx("name"); when they do interact with an API exposing the type.

I've been thinking about which type to use, and I think regular int will do. For CSV files with over 2 billion rows or columns it probably becomes impractical to use rapidcsv anyway (as rapidcsv keeps the entire parsed CSV in memory so the memory usage would be... quite high..). int64_t would be a safer choice, but it has performance impact on 32-bit environments.

from rapidcsv.

d99kris avatar d99kris commented on May 25, 2024

I've created a PR #139 for switching ssize_t usage to int. Feel free to provide feedback on the change in the review. If there are no major concerns I will proceed to merge it next weekend probably.

from rapidcsv.

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.