V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
noahzh
V2EX  ›  Go 编程语言

被 cgo 的 union 折磨的不要不要的

  •  1
     
  •   noahzh · 2023-03-01 15:11:46 +08:00 · 1044 次点击
    这是一个创建于 422 天前的主题,其中的信息可能已经有所发展或是发生改变。
    typedef struct tagVARIANT {
    	 union 
    	{
    		 struct
    		{
    			VARTYPE vt;
    			 union
    			{
    				int64_t llVal;
    				int32_t lVal;
    				int16_t iVal;
    				int8_t bVal;
    				float fltVal;
    				double dblVal;
    				double date;
    				char* cstrVal;
    				short* bstrVal;
    				void* pyref;
    				int8_t* pbVal;
    				int16_t* piVal;
    				int32_t* plVal;
    				int64_t* pllVal;
    				float* pfltVal;
    				double* pdblVal;
    				double* pdate;
    				char** pcstrVal;
    				short** pbstrVal;
    				SAFEARRAY* parray;
    				VARIANT* pvarVal;
    			} __VARIANT_NAME_3;
    		} __VARIANT_NAME_2;
    	} __VARIANT_NAME_1;
    } tagVARIANT;
    

    cgo 处理 union 太痛苦了,大家有什么好的解决办法吗?谢谢。

    3 条回复    2023-03-02 15:32:25 +08:00
    elechi
        3
    elechi  
       2023-03-02 15:32:25 +08:00
    OP 这是搞得实时数据库吧
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   887 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 21:41 · PVG 05:41 · LAX 14:41 · JFK 17:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.