g++ command line macro define byte stream

前端 未结 1 1314
忘掉有多难
忘掉有多难 2021-01-28 16:32

I\'m looking for the solution to define a byte stream as a macro from gcc/g++ command line via option -D, e.g. -Dxxx=byte_stream.

Below is the code snippet,



        
1条回答
  •  余生分开走
    2021-01-28 16:36

    First this depends a lot from your environment, and the shell that you are using. For /bin/sh you could try something like

    -DMAGIC_BYTES='"\x01\x02"'
    

    that is escape the whole string with ''.

    0 讨论(0)
提交回复
热议问题