gnu-runtime-2.mm

来自「Mac OS X 10.4.9 for x86 Source Code gcc」· MM 代码 · 共 32 行

MM
32
字号
/* APPLE LOCAL file mainline *//* Sanity check for GNU-runtime version of constant strings,   regardless of runtime used on target system.  *//* { dg-do compile } *//* { dg-options "-fgnu-runtime" } */#include <objc/Object.h>#include <string.h>#include <stdlib.h>@interface NXConstantString: Object{  char *c_string;  unsigned int len;                                                     }-(const char *) cString;-(unsigned int) length;@end@implementation NXConstantString-(const char *) cString { return c_string; }-(unsigned int) length  { return len; }@endint main(int argc, void **args){  if (strcmp ([@"this is a string" cString], "this is a string"))    abort ();  return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?