doupu1949 2019-03-29 10:25
浏览 43

哪些构建约束条款可用于区分32位整数和64位整数?

I want to define a constant whose numeric value depends on whether int is a 32-bit or a 64-bit type on a particular target architecture. It's possible to compile go source files conditionally using Build constraints.

Are there simple build constraint clauses with predefined tags which select for one or the other? Ideally, something like:

//+build 32bit

Otherwise, I'd either have to somehow detect the size externally and use custom build tags, or maintain a large list of predefined target tags which may change with each go release. Is there a simpler way?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 luckysheet
    • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
    • ¥15 找一位技术过硬的游戏pj程序员
    • ¥15 matlab生成电测深三层曲线模型代码
    • ¥50 随机森林与房贷信用风险模型
    • ¥50 buildozer打包kivy app失败
    • ¥30 在vs2022里运行python代码
    • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
    • ¥15 求解 yolo算法问题
    • ¥15 虚拟机打包apk出现错误