Fixed-width integers in C++

后端 未结 6 1983
梦谈多话
梦谈多话 2020-12-10 01:59

Occasionally I need to use fixed-width integers for communication with external devices like PLCs. I also use them to define bitmasks and perform bit manipulation of image d

6条回答
  •  有刺的猬
    2020-12-10 02:30

    I've used a public domain (not GPL - true public domain) version of stdint.h by Danny Smith that's available in the mingw package:

    • http://www.mingw.org/download.shtml

    I had to tweak that version to compile with some non VC 8 compilers (mostly VC6) - it has served me well.

    Maybe one of these days I'll get around to posting my VC6-compatible version somewhere. The changes were pretty minor - just some macro trickery to use VC6 specific keywords for 64-bit types. If you don't need VC6 support, the mingw version should probably be all you need.

提交回复
热议问题