PHP源码常用代码宏定义:#define 宏名 字符串#表示这是一条预处理命令,所有的预处理命令都以#开头.define是预处理命令.宏名是标识符的一种,命名规则和标识符相同.字符串可以是常数.表达式等.在编译预处理时,对程序中所有出现的"宏名",都用宏定义中的字符串去代换,这称为"宏代换"或"宏展开". 1.#define PHP_FUNCTION ZEND_FUNCTION在编译预处理阶段会把PHP_FUNCTION 替换成 ZEND_FUN…
#define checkNull(__X__) (__X__) == [NSNull null] || (__X__) == nil ? @"" : [NSString stringWithFormat:@"%@",                        (__X__)]…
/**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2013-2015 Chukong Technologies Permission is hereby granted, free of charge, to any person obtaining a copy of this soft…
网上对IOS的宏定义比较多,我总结了一些最常用的宏,后续还会继续补上. 1.首次启动判断: #define First_Launched @"firstLaunch" 2.ios7系统判断: #define IsIOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >=7.0 ? YES : NO) 3.判断是否Retina屏.是否IPhone5.是否IPad #define isRetina ([UIScreen…
一. 总览 1.1库函数 函数名 头文件 功能 原型 说明 syslog syslog.h 记录至系统记录(日志) void    syslog(int, const char *, ...) __printflike(2, 3) 参数1:优先级,参数2:要输出到系统日志的 参数3:(格式化)字符串 perror stdio.h 将上个函数错误原因输出至stderr void     perror(const char *) 参数:要优先打印到stderr的字符串 memset string.h…
下面我为大家提供一些常用的宏定义! 将这些宏定义 加入到.pch使用 再也不用 用一次写一次这么长的程序了 //-------------------获取设备大小------------------------- //NavBar高度 #define NavigationBar_HEIGHT 44 //获取屏幕 宽度.高度 #define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width) #define SCREEN_HEIGHT ([…
转自:http://www.jianshu.com/p/213b3b96cafe 前言: 在工作中, 很多小伙伴都会在PCH文件定义一些常用的宏,但是又怕写这些简单的宏浪费时间,又有时候忘记怎么定义了怎么办?本人在工作中也是如此.所以在这里给大家分享一些常用的宏定义,喜欢的小伙伴可以直接在项目中使用(持续更新)!为了大家使用方便,请点击GitHub - 宏定义头文件下载 ! 1.获取屏幕宽度与高度 #define SCREEN_WIDTH [UIScreen mainScreen].bounds…
1.处理NSLog事件(开发者模式打印,发布者模式不打印) 1 2 3 4 5   #ifdef DEBUG   #define NSLog(FORMAT, ...) fprintf(stderr,"%s:%d\t%s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS…
1.首次启动判断: #define First_Launched @"firstLaunch" 2.ios7系统判断: #define IsIOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >=7.0 ? YES : NO) 3.判断是否Retina屏.是否IPhone5.是否IPad #define isRetina ([UIScreen instancesRespondToSelector: @select…
总结了iOS开发过程中的一些常用宏,以后会陆陆续续添加进来. 字符串是否为空 1   #define kStringIsEmpty(str) ([str isKindOfClass:[NSNull class]] || str == nil || [str length] < 1 ? YES : NO ) 数组是否为空 1   #define kArrayIsEmpty(array) (array == nil || [array isKindOfClass:[NSNull class]] ||…