What is the type of an enum whose values appear to be strings?

后端 未结 4 1944
广开言路
广开言路 2020-12-31 07:03

I am working with Apple\'s ScriptingBridge framework, and have generated a header file for iTunes that contains several enums like this:

         


        
4条回答
  •  半阙折子戏
    2020-12-31 08:00

    That is an Apple extension to C, which It basically translates those enums to:

    typedef enum {
        iTunesESrcLibrary = 'k'<<24 | 'L'<<16 | 'i'<<8 | 'b',
     ...
     }
    

    EDIT: Sorry, apparently it's valid C. I've only seem them in Mac code, so wrongly assumed that it was Apple specific.

提交回复
热议问题