Win32 data types equivalant in Linux

前端 未结 4 1467
故里飘歌
故里飘歌 2021-02-09 17:41

I am trying to convert a C++ library which is using widely DWORD, CString and BYTE in the program, and now I am converting the code from C++ Win32 library to linux program . Als

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-09 18:01

    I would suggest to use uint32_t and uint8_t from for DWORD and BYTE and normal char * or const char * for strings (or the std:string class for C++).

    Probably best thought is to use typedefs for existing code:

    typedef unsigned char             BYTE;
    

    These can be changed easily.

    If you rewrite code use char, int, long were useful and the (u)intX_t types, were you need a defined size.

提交回复
热议问题