关于DECONST

| 1 Comment | No TrackBacks |

#define DE_CONST(konst, var) do { union { const void *k; void *v; } _u; _u.k = konst; var = _u.v; } while (0)

#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))

颚的神啊……

No TrackBacks

TrackBack URL: https://blog.delphij.net/mt/mt-tb.cgi/1502

1 Comment

这个……没啥问题吧?如果都是给指针/地址使用的话

第二个假设了unsigned long和void *长度一样,到目前为止也还是正确的。

Leave a comment

Monthly Archives

Pages

OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.2.3