The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
noahzh

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

  •  1
     
  •   noahzh · Mar 1, 2023 · 2152 views
    This topic created in 1196 days ago, the information mentioned may be changed or developed.
    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 replies    2023-03-02 15:32:25 +08:00
    elechi
        3
    elechi  
       Mar 2, 2023
    OP 这是搞得实时数据库吧
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   923 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 21:33 · PVG 05:33 · LAX 14:33 · JFK 17:33
    ♥ Do have faith in what you're doing.