开发者

How do I wrap a primitive data type like int to uint8_t?

I need to be able to wrap a primitive data type. But I'm not sure how to proceed. The using clause (as below) works fine if its only f开发者_如何学Goor one file, but I need to be able to use it in my whole project.

Eg.

using int8_t = System.SByte;
using uint8_t = System.Byte;
using int16_t = System.Int16;
using uint16_t = System.UInt16;

Any help would be greatly appreciated.

Updated from comments:

We are using Enterprise Architect to generate our code (C#, C++, Java). And we need the code bases to be the same. So we need to be able to wrap the base types to be able to do that. With C/C++ is easy, we just use "typedef short int16_t;". But I need to be able to do it in C# as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜