doorxp-blog

doorxp.com

Using enum classes as type-safe bitmasks

IntroIn C++, bitmasks are often represented by eitherpreprocessor defines#define Readable   0x4 #define Writeable  0x2 #define Executable 0x1 unsigned permissions = Readable | E

Keypath for any element in embedded NSArray

@interface NSArray (SubscriptKey) @end @implementation NSArray (SubscriptKey) - (id)valueForUndefinedKey:(NSString *)key {     if ([key isEqualToString:@"size"]) { &

Mac OSX 下 MacPorts 环境,编译OpenWrt

sudo port install 所有差的库,只有openssl 安装了还要提示下面的错误:Please install the openssl library (with development headers)解决方案如下:找到 OpenWrt/include/host-build.mkifeq ($(HOST_OS),Darwin)   HOST_CFLAGS += -I/usr/local/opt/openssl/include &

Assembler Directives

This chapter describes assembler directives (also known as pseudo operations, or pseudo-ops), which allow control over the actions of the assembler.Directives for Designating the Current SectionThe assembler supports designation of arbitrar

github readme.md 添加图片

   将图片放在仓库里面,在文件里链接它,最后 push 到 github 上。  ![image](${yourname} 你的账号名字${repositoryName} github的库名字${imagepath} 基于你的库的路径${imageName} 图片全名以上有特殊字符的要url编码

读取数据(嵌入的plist)链接通过-sectcreate __TEXT为可执行

我用连接使用的plist一个可执行-sectcreate __TEXT连接器选项。clang -Wl,-sectcreate,__TEXT,__info_plist,info.plist -dynamiclib -o a.dylib a.cppotool你可以用otool(1)转储包含嵌入的plist的部分内容:otool -s __TEXT __info_plist /path/to/executable 然后通过管道将其输出,以便获得相应的ASCII表示XXD(1):otool -

include/mach-o/dyld-interposing.h

/*  * Copyright (c) 2005-2008 Apple Computer, Inc. All rights reserved.  *  * @APPLE_LICENSE_HEADER_START@  *   * This file contains Original&nbs

shared library is loaded auto run

It's run when a shared library is loaded, typically during program startup.1. before mainvoid tmain() __attribute__((constructor(101))){     printf("abc\n"); }2.module inittypedef  void (IN

OSX 下编译 upx

依赖库编译ucl下载地址:http://www.oberhumer.com/opensource/ucl/#download    解压,进入文件夹./configure make allupx下载 upxexport UPX_UCLDIR=path to ucl sourcemake all输出文件为:upx.out

宏的更高级应用.

当中 objc源文件中要写一个 JS 代码或 json, 怎样让它语法高亮方法如下:定义一个红#define JS(x) #x但上面的红有个问题,就是宏中不能有逗号,解决方案如下:p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 19.0px Helvetica; color: #eb905a; background-color: #000000}#define JS(...) #__VA_ARGS__实际效果如下.

Powered By Z-BlogPHP 1.5.1 Zero

Copyright doorxp.com Rights Reserved.