FPC的编译宏

FPC的编译宏分为两种,一种是编译条件如IF,一种是编译指令INCLUDE
如下:
        AddDirective('I',directive_all, @dir_include);          头文件
        AddDirective('DEFINE',directive_all, @dir_define);      定义
        AddDirective('UNDEF',directive_all, @dir_undef);    撤消定义

    以下几个属于条件宏
        AddConditional('IF',directive_all, @dir_if);        IF    
        AddConditional('IFDEF',directive_all, @dir_ifdef);    IFDEF    
        AddConditional('IFNDEF',directive_all, @dir_ifndef);    IFNDEF
        AddConditional('ELSE',directive_all, @dir_else);    ELSE    
        AddConditional('ELSEIF',directive_all, @dir_elseif);    ELSEIF
        AddConditional('ENDIF',directive_all, @dir_endif);    ENDIF

        { Directives and conditionals for all modes except mode macpas}
        AddDirective('INCLUDE',directive_turbo, @dir_include);            头文件
        AddDirective('LIBPREFIX',directive_turbo, @dir_libprefix);        LIB前缀,将编译后LIB加上前缀或后缀
        AddDirective('LIBSUFFIX',directive_turbo, @dir_libsuffix);        LIB后缀
        AddDirective('EXTENSION',directive_turbo, @dir_extension);        设置文件扩展(如test.EXE->Test+扩展.exe)

    AddConditional('IFEND',directive_turbo, @dir_endif);    ENDIF
        AddConditional('IFOPT',directive_turbo, @dir_ifopt);    IFOPT 即判断是否定义某个参数



        AddDirective('A1',directive_all, @dir_a1);        对齐1
        AddDirective('A2',directive_all, @dir_a2);        对齐2
        AddDirective('A4',directive_all, @dir_a4);        对齐4
        AddDirective('A8',directive_all, @dir_a8);        对齐8
        AddDirective('ALIGN',directive_all, @dir_align);    对齐1到32    

        AddDirective('APPTYPE',directive_all, @dir_apptype);        应用类型,如GUI,CONSOLE
        AddDirective('ASMMODE',directive_all, @dir_asmmode);        汇编模式, 如i386或ARM等等,将按照模式编译程序
        AddDirective('ASSERTIONS',directive_all, @dir_assertions);    断言开关
        AddDirective('BOOLEVAL',directive_all, @dir_booleval);        BOOLVAL开关
        AddDirective('BITPACKING',directive_all, @dir_bitpacking);    即允许PACK包按位对齐
        AddDirective('CALLING',directive_all, @dir_calling);        CALL类型如register pascal
        AddDirective('CHECKPOINTER',directive_all, @dir_checkpointer);    检查指针,代码生成器将生成一段检查指针代码
        AddDirective('CODEALIGN',directive_all, @dir_codealign);    写PPU时各个代码方式以键值对方式如proc,jump等
        AddDirective('CODEPAGE',directive_all, @dir_codepage);        代码页如utf8格式
        AddDirective('COPERATORS',directive_all, @dir_coperators);    支持c格式运算符,+=,-=,*=,/=
        AddDirective('COPYRIGHT',directive_all, @dir_copyright);    版权,只适合netware操作系统
        AddDirective('D',directive_all, @dir_description);        修改描述
        AddDirective('DEBUGINFO',directive_all, @dir_debuginfo);        模块是否有DEBUGINFO
        AddDirective('DESCRIPTION',directive_all, @dir_description);        修改描述
        AddDirective('ERROR',directive_all, @dir_error);        打印错误信息
        AddDirective('EXTENDEDSYNTAX',directive_all, @dir_extendedsyntax);    扩展语法
        AddDirective('FATAL',directive_all, @dir_fatal);        打印严重异常
        AddDirective('FPUTYPE',directive_all, @dir_fputype);        设置FPU(浮点处理器类型)
        AddDirective('FRAMEWORKPATH',directive_all, @dir_frameworkpath);    框架路径,只有主模块才有效
        AddDirective('GOTO',directive_all, @dir_goto);        模块是否支持GOTO语句
        AddDirective('HINT',directive_all, @dir_hint);        打印提示信息
        AddDirective('HINTS',directive_all, @dir_hints);        设置编译提示级别,如Fatal,Error
        AddDirective('IEEEERRORS',directive_all,@dir_ieeeerrors);    设置ieee_error类型
        AddDirective('IOCHECKS',directive_all, @dir_iochecks);        IO检查,与指针检查类型一样,生成代码时添加一段检查代码
        AddDirective('IMAGEBASE',directive_all, @dir_imagebase);    设置IMAGE映射地址
        AddDirective('IMPLICITEXCEPTIONS',directive_all, @dir_implicitexceptions);    生成代码时为init,fina添加隐性异常
        AddDirective('INCLUDEPATH',directive_all, @dir_includepath);    头文件路径
        AddDirective('INFO',directive_all, @dir_info);        打印一般信息
        AddDirective('INLINE',directive_all, @dir_inline);    支持INLINE
        AddDirective('L',directive_all, @dir_link);        设置链接文件目录
        AddDirective('LIBRARYPATH',directive_all, @dir_librarypath);    LIB路径
        AddDirective('LINK',directive_all, @dir_link);            与I相同
        AddDirective('LINKFRAMEWORK',directive_all, @dir_linkframework);    框架链接文件路径    
        AddDirective('LINKLIB',directive_all, @dir_linklib);            生成LIB名
        AddDirective('LONGSTRINGS',directive_all, @dir_longstrings);        默认string为长字符串
        AddDirective('M',directive_all, @dir_memory);            定义栈与堆大小
        AddDirective('MACRO',directive_all, @dir_macro);        定义宏
        AddDirective('MAXFPUREGISTERS',directive_all, @dir_maxfpuregisters);    设置最大fpu寄存器个数
        AddDirective('MAXSTACKSIZE',directive_all, @dir_maxstacksize);        设置最大栈大小
        AddDirective('MEMORY',directive_all, @dir_memory);            与M相同
        AddDirective('MESSAGE',directive_all, @dir_message);        MESSAGE打印
        AddDirective('MINENUMSIZE',directive_all, @dir_packenum);        最小pack大小1,2,4,8
        AddDirective('MINFPCONSTPREC',directive_all, @dir_minfpconstprec);    设置浮点类型    
        AddDirective('MINSTACKSIZE',directive_all, @dir_minstacksize);        最小栈大小
        AddDirective('MMX',directive_all, @dir_mmx);                支持MMX
        AddDirective('MODE',directive_all, @dir_mode);                模式,如m_fpc,m_objfpc,m_delphi,m_tp7,m_mac
        AddDirective('MODESWITCH',directive_all, @dir_modeswitch);        是否允许切换模式开关    
        AddDirective('NOTE',directive_all, @dir_note);                打印注意信息
        AddDirective('NOTES',directive_all, @dir_notes);            设置打印注意信息级别
        AddDirective('OBJECTCHECKS',directive_all, @dir_objectchecks);        添加运行时对象类型检查
        AddDirective('OBJECTPATH',directive_all, @dir_objectpath);        本地对象文件路径
        AddDirective('OPENSTRINGS',directive_all, @dir_openstrings);        类似短字符串string[255]
        AddDirective('OPTIMIZATION',directive_all, @dir_optimization);        是否打开优化
        AddDirective('OV',directive_mac, @dir_overflowchecks);            溢出检查,有编译时也有运行时
        AddDirective('OVERFLOWCHECKS',directive_all, @dir_overflowchecks);    同OV
        AddDirective('PACKENUM',directive_all, @dir_packenum);            同MINENUMSIZE
        AddDirective('PACKRECORDS',directive_all, @dir_packrecords);        RECORD最小的大小1,2,4,8,16,32
        AddDirective('PACKSET',directive_all, @dir_packset);            内存分配最小的大小1,2,4,8
        AddDirective('PASCALMAINNAME',directive_all, @dir_pascalmainname);    主函数名字默认main
        AddDirective('PROFILE',directive_all, @dir_profile);        宏定义文件
        AddDirective('R',directive_all, @dir_resource);            资源路径
        AddDirective('RANGECHECKS',directive_all, @dir_rangechecks);    边界检查
        AddDirective('RESOURCE',directive_all, @dir_resource);        同R
        AddDirective('SATURATION',directive_all, @dir_saturation);    支持MMX多媒体增强指令集
        AddDirective('SETPEFLAGS', directive_all, @dir_setpeflags);    设置PE文件的FLAG标志
        AddDirective('SMARTLINK',directive_all, @dir_smartlink);    小型链接
        AddDirective('STACKFRAMES',directive_all, @dir_stackframes);    栈帧生成PE文件时要用
        AddDirective('TYPEINFO',directive_all, @dir_typeinfo);        产生RTTI信息
        AddDirective('UNITPATH',directive_all, @dir_unitpath);        添加本地单元路径
        AddDirective('VARSTRINGCHECKS',directive_all, @dir_varstringchecks);    检查字符串类型,是否长字符串
        AddDirective('WAIT',directive_all, @dir_wait);        等待你输入ENTER按键
        AddDirective('WARN',directive_all, @dir_warn);        警告开关或类型
        AddDirective('WARNING',directive_all, @dir_warning);        设置警告级别
        AddDirective('WARNINGS',directive_all, @dir_warnings);        同WARNING    
        AddDirective('WRITEABLECONST',directive_all, @dir_writeableconst);    可写常量
        AddDirective('Z1',directive_all, @dir_z1);        Z1    设置包大小1
        AddDirective('Z2',directive_all, @dir_z2);        Z2    设置包大小2
        AddDirective('Z4',directive_all, @dir_z4);              Z3    设置包大小4

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值