{"id":34118,"date":"2015-11-19T00:38:09","date_gmt":"2015-11-18T15:38:09","guid":{"rendered":"http:\/\/www.softantenna.com\/wp\/?p=34118"},"modified":"2015-11-19T00:38:09","modified_gmt":"2015-11-18T15:38:09","slug":"preprocessor-fun","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/preprocessor-fun\/","title":{"rendered":"\u9000\u8077\u524d\u3067\u3082\u30c0\u30e1\u7d76\u5bfe\uff01\u8d85\u5371\u967a\u306a\u30d8\u30c3\u30c0\u30fc\u30d5\u30a1\u30a4\u30eb\u300cpreprocessor_fun.h\u300d"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2015\/11\/Ihacking.jpg\" alt=\"Hacking\" title=\"hacking.jpg\" border=\"0\" width=\"545\" height=\"409\" \/><\/p>\n<p>\u3044\u307e\u3060\u306b\u9ad8\u3044\u4eba\u6c17\u3092\u8a87\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u300cC\u300d\u3002\u30d7\u30ea\u30d7\u30ed\u30bb\u30c3\u30b5\u3092\u5229\u7528\u3057\u305f\u67d4\u8edf\u6027\u306e\u9ad8\u3044\u8a18\u8ff0\u304c\u53ef\u80fd\u306a\u70b9\u3082\u9b45\u529b\u306e\u4e00\u3064\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u7d39\u4ecb\u3059\u308b\u30d8\u30c3\u30c0\u30fc\u30d5\u30a1\u30a4\u30eb\u300c<a href=\"https:\/\/gist.github.com\/aras-p\/6224951\">preprocessor_fun.h<\/a>\u300d\u306f\u3001\u3053\u306e\u67d4\u8edf\u6027\u306e\u9ad8\u3055\u3092\u9006\u7528\u3057\u3066\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u307e\u3068\u3082\u306b\u52d5\u304b\u306a\u3044\u3088\u3046\u306b\u6539\u9020\u3059\u308b\u3001\u5371\u967a\u306a\u30d8\u30c3\u30c0\u30fc\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u300cif => while\u300d\u306e\u3088\u3046\u306a\u7c21\u5358\u306a\u30ad\u30fc\u30ef\u30fc\u30c9\u306e\u7f6e\u63db\u304b\u3089\u3001<\/p>\n<pre><code class=\"c\">\/\/ Easy keyword replacement. Too easy to detect I think!\n#define struct union\n#define if while\n#define else\n#define break\n#define if(x)\n#define double float\n#define volatile \/\/ this one is cool\n<\/code><\/pre>\n<p>\u300cfloor => ceil\u300d\u306e\u3088\u3046\u306a\u6570\u5b66\u7cfb\u306e\u3082\u306e\u3001<\/p>\n<pre><code class=\"c\">\/\/ I heard you like math\n#define M_PI 3.2f\n#undef FLT_MIN #define FLT_MIN (-FLT_MAX)\n#define floor ceil\n#define isnan(x) false\n<\/code><\/pre>\n<p>\u3060\u3044\u305f\u3044\u52d5\u304f\u3051\u3069\u305f\u307e\u306b\u52d5\u304b\u306a\u3044\u3001rand()\u7b49\u3092\u5229\u7528\u3057\u305f\u30c7\u30d0\u30c3\u30b0\u306e\u96e3\u3057\u305d\u3046\u306a\u3082\u306e\u307e\u3067\u6e96\u5099\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><code class=\"c\">\/\/ Randomness based; \"works\" most of the time.\n#define true ((__LINE__&15)!=15)\n#define true ((rand()&15)!=15)\n#define if(x) if ((x) && (rand() < RAND_MAX * 0.99))\n<\/code><\/pre>\n<p>\u300c\u4ed5\u4e8b\u3092\u8f9e\u3081\u308b\u524d\u306b\u8ffd\u52a0\u3059\u308b\u3068\u3044\u3044\u3088\u300d\u3068\u30b3\u30e1\u30f3\u30c8\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3082\u3061\u308d\u3093\u3053\u308c\u306f\u30b8\u30e7\u30fc\u30af\u3067\u3057\u3087\u3046\u3002\u5b9f\u884c\u3059\u308b\u3068\u5927\u554f\u984c\u306b\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u982d\u306e\u4f53\u64cd\u3001\u3042\u308b\u3044\u306f\u5b9f\u9a13\u3060\u3051\u306b\u3068\u3069\u3081\u3066\u304a\u3044\u305f\u65b9\u304c\u826f\u3044\u3068\u601d\u308f\u308c\u307e\u3059\u3002<a href=\"https:\/\/news.ycombinator.com\/item?id=10084570\">Hacker News<\/a>\u3067\u306f\u3055\u3089\u306a\u308b\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u3082\u691c\u8a0e\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u3061\u3089\u3082\u53c2\u8003\u307e\u3067\u306b\u3069\u3046\u305e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3044\u307e\u3060\u306b\u9ad8\u3044\u4eba\u6c17\u3092\u8a87\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u300cC\u300d\u3002\u30d7\u30ea\u30d7\u30ed\u30bb\u30c3\u30b5\u3092\u5229\u7528\u3057\u305f\u67d4\u8edf\u6027\u306e\u9ad8\u3044\u8a18\u8ff0\u304c\u53ef\u80fd\u306a\u70b9\u3082\u9b45\u529b\u306e\u4e00\u3064\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002 \u4eca\u56de\u7d39\u4ecb\u3059\u308b\u30d8\u30c3\u30c0\u30fc\u30d5\u30a1\u30a4\u30eb\u300cpreprocessor_fun.h\u300d\u306f\u3001\u3053\u306e\u67d4\u8edf\u6027\u306e\u9ad8\u3055\u3092\u9006 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":34117,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[75],"tags":[3354],"class_list":["post-34118","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-preprocessor"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/34118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=34118"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/34118\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/34117"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=34118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=34118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=34118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}