• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            What is "##" string in C code

            See code below(quoting ffmpeg source code)
             1 #define REGISTER_MUXER(X,x) { \
             2     extern AVOutputFormat x##_muxer; \
             3     if(CONFIG_##X##_MUXER) av_register_output_format(&x##_muxer); }
             4 #define REGISTER_DEMUXER(X,x) { \
             5     extern AVInputFormat x##_demuxer; \
             6     if(CONFIG_##X##_DEMUXER) av_register_input_format(&x##_demuxer); }
             7 #define REGISTER_MUXDEMUX(X,x)  REGISTER_MUXER(X,x); REGISTER_DEMUXER(X,x)
             8 #define REGISTER_PROTOCOL(X,x) { \
             9     extern URLProtocol x##_protocol; \
            10     if(CONFIG_##X##_PROTOCOL) av_register_protocol2(&x##_protocol, sizeof(x##_protocol)); }

            "##" string in C language code is used for concatenating the two strings which is before and behind it  in a macros definition.
            See a test code below :
            1 #define DEFINE(t, x)  {t x##_##t;}
            3 int main()
            4 {
            5     DEFINE(int, vvv);
            6     return 0;
            7 }

            Use "gcc -E test_sharpsharp.c -o test_sharpsharp.i" command to pre-process this file
            And the output file "test_sharpsharp.i" just looks like below :
            1 int main()
            2 {
            3     {int vvv_int;};
            4     return 0;
            5 }

            The code below is useful, and you can use "##" macro definitions to realize sample templates with C language
            1 #define REGISTER_DATA_COMPARE(x)\
            2     static __inline x x##_compare(x key1, x key2)\
            3     {\
            4         if (key1 > key2) return 1;\
            5         if (key1 < key2) return -1;\
            6         return 0;\
            7     }
            In this way, you can realize a data comparing function set, when you need comparing some type of data, just register it.

            posted on 2012-06-08 10:42 Apollo Fang 閱讀(296) 評論(0)  編輯 收藏 引用 所屬分類: Miscellaneous

            導航

            隨筆分類

            隨筆檔案

            最新評論

            久久久久亚洲Av无码专| 午夜精品久久久内射近拍高清| 久久成人精品| 国产精品久久久久a影院| 久久久久亚洲精品日久生情| 999久久久免费精品国产| 亚洲精品美女久久久久99| 亚洲精品无码久久千人斩| 无码人妻精品一区二区三区久久 | 久久婷婷五月综合国产尤物app | 亚洲国产成人久久精品影视| 精品久久久一二三区| 国产一区二区三区久久| 久久人人爽人人爽人人片av麻烦 | 亚洲国产成人久久笫一页| 国产成人综合久久综合| 久久天天躁狠狠躁夜夜avapp| 蜜桃麻豆www久久国产精品| 99久久综合狠狠综合久久止| 综合网日日天干夜夜久久| 国产激情久久久久影院老熟女| 久久久久亚洲Av无码专| 久久午夜福利无码1000合集| 热综合一本伊人久久精品| 大蕉久久伊人中文字幕| 国产一区二区三区久久精品| 久久香综合精品久久伊人| 亚洲中文久久精品无码ww16| 久久伊人五月丁香狠狠色| 久久强奷乱码老熟女网站| 久久久久久久国产免费看| 久久性精品| 日韩美女18网站久久精品| 人妻无码精品久久亚瑟影视| 久久婷婷五月综合色99啪ak| 久久久青草青青国产亚洲免观| 久久中文精品无码中文字幕| 久久久久亚洲AV成人网| 亚洲成av人片不卡无码久久| 久久精品国产亚洲AV忘忧草18| 久久国产色av免费看|