Including and in the same project

前端 未结 2 757
逝去的感伤
逝去的感伤 2020-12-20 22:33

What I want to achieve: I want to set custom baud rate values for some tty*-like UART-mapped terminals.

How: The only way I fo

2条回答
  •  清歌不尽
    2020-12-20 23:04

    How can I solve this without using some obscure practice (like wrapping one of headers in a namespace, like mentioned here)?

    If you find namespaces obscure, I don't know how you'd call this:

    #define termios asmtermios
    #include 
    #undef  termios
    #include 
    

    Anyway, this too gets you rid of the error: redefinition of 'struct termios'.

提交回复
热议问题