需求:解决make时候NSLog方法undeclared错误
**日志:
make
==> Notice: Build may be slow as Theos isn’t using all available CPU cores on this computer. Consider upgrading GNU Make: https://github.com/theos/theos/wiki/Parallel-Building
Making all for tweak readingcrack…
==> Compiling src/PFLListenBookVC_test.xm (arm64)…
src/PFLListenBookVC_test.xm:4:181: error: use of undeclared identifier ‘NSLog’
…__unused self, SEL __unused _cmd, _Bool hasReport) { NSLog(@"-[<PFLList…
^
src/PFLListenBookVC_test.xm:5:160: error: use of undeclared identifier ‘NSLog’
…_LOGOS_SELF_CONST __unused self, SEL __unused _cmd) { NSLog(@"-[<PFLList…
我只拷贝了两个这个错误,实际凡是有NSLog的地方都报这个错误。
**代码:
.xm部分代码
…
- (_Bool )hasListenFinished { %log; _Bool r = %orig; NSLog(@" = %d", r); return r; }
- (void)setCurrentListenPageIndex:(unsigned long long )currentListenPageIndex { %log; %orig; }
- (unsigned long long )currentListenPageIndex { %log; unsigned long long r = %orig; NSLog(@" = %llu", r); return r; }
…
操作步骤:
Logify 使用.h头文件自动生成的.xm 文件,已经手动去除__weak, inout, cxx_ destruct,类*替换为void *
** 任何其他描述: 无
** 环境: mac catalina,Xcode 12