erincatto / box2d

Box2D is a 2D physics engine for games
https://box2d.org
MIT License
8.36k stars 1.55k forks source link

Enhancement request: provide version information in header file #704

Closed check-switch-26 closed 3 months ago

check-switch-26 commented 2 years ago

It is useful to be able to query the version number at compile time - particularly to accommodate differences in the API between versions. (I note that many other libraries provide the same; e.g., FFmpeg, OpenCV, zlib, etc.)

Please consider adding #defines major/minor/revision info in b2_settings.h

erincatto commented 2 years ago

Please see extern B2_API b2Version b2_version; in b2_common.h

check-switch-26 commented 2 years ago

Hi, Erin.

The enhancement request is to be able to query the library version at COMPILE time, not run time. For example:

if BOX2D_MAJOR_VERSION > 2

Thanks. --Ted

On Thu, Dec 30, 2021, 5:54 PM Erin Catto @.***> wrote:

Please see extern B2_API b2Version b2_version; in b2_common.h

— Reply to this email directly, view it on GitHub https://github.com/erincatto/box2d/issues/704#issuecomment-1003227396, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWLGU2R3WAIEEXAINZFQEIDUTT5LLANCNFSM5JUH2V2Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>