`
enter775
  • 浏览: 20909 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

LOCAL_C, LOCAL_D, GLREF_C, GLREF_D, GLDEF_C and GLDEF_D

阅读更多

LOCAL_C , LOCAL_D , GLREF_C, GLREF_D, GLDEF_C and GLDEF_D are all defined in e32def.h as:

#define GLREF_D extern
#define GLDEF_D
#define LOCAL_D static
#define GLREF_C extern
#define GLDEF_C
#define LOCAL_C static

The _C and _D suffixes are a convention. _D indicates a data declaration, and _C a code one.

So LOCAL_D is used to indicate a static data while LOCAL_C indicates static code.

By contrast, GLREF_C and GLREF_D, by contrast, are used to indicated GLobal REFerences (i.e. extern), and GLDEF_C and GLDEF_D indicate GLobal DEFinitions. These terms don’t have a formal definition but are used as markers for functions or variables which have been declared as GLREF_C or GLREF_D respectively elsewhere.

 

这些宏被定义在 e32def.h 头文件中,如下:

#define GLREF_D extern
#define GLDEF_D
#define LOCAL_D static
#define GLREF_C extern
#define GLDEF_C
#define LOCAL_C static

后缀 _D 和 _C 是 EPOC 的的一个约定,_D 指数据声明(declaration of D ata),_C 指代码定义(definition of C ode)。

这里,static 被 LOCAL_C 和 LOCAL_D 所取代。

GLREF_C 和 GLREF_D 被指定为全局引用(GLobal REFerence):extern 。

GLDEF_C 和 GLDEF_D 指定了一个全局定义(GLobal DEFination)。这两个宏没有给出一个固定的定义,但是它们被作为函数和变量的记号。

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics