{"id":19553,"date":"2022-07-13T00:12:02","date_gmt":"2022-07-12T22:12:02","guid":{"rendered":"https:\/\/daniel.haxx.se\/blog\/?p=19553"},"modified":"2022-07-13T00:12:02","modified_gmt":"2022-07-12T22:12:02","slug":"predef-is-our-friend","status":"publish","type":"post","link":"https:\/\/daniel.haxx.se\/blog\/2022\/07\/13\/predef-is-our-friend\/","title":{"rendered":"predef is our friend"},"content":{"rendered":"\n<p>For C programmers like me, who want to write portable programs that can get built and run on the widest possible array of machines and platforms, we often need to write conditional code. Code that use <code>#ifdefs<\/code> for particular conditions.<\/p>\n\n\n\n<p>Such ifdefs expressions often need to check for a particular compiler, an operating system or perhaps even a specific version of of one those things.<\/p>\n\n\n\n<p>Back in April 2002, Bj\u00f8rn Reese created the predef project and started collecting this information on a page on Sourceforge. I found it a super useful idea and I have tried to contribute what I have learned through the years to the effort.<\/p>\n\n\n\n<p>The collection of data has been maintained and slowly expanded over the years thanks to contributions from many friends.<\/p>\n\n\n\n<p>The predef documents have turned out to be a genuine goldmine and a resource I regularly come back to time and time again, when I work on projects such as <a href=\"https:\/\/curl.se\/\">curl<\/a>, <a href=\"https:\/\/c-ares.org\/\">c-ares<\/a> and <a href=\"https:\/\/libssh2.org\/\">libssh2<\/a> and need to make sure they remain functional on a plethora of systems. I can only imagine how many others are doing the same for their projects. Or maybe <em>should<\/em> do the same&#8230;<\/p>\n\n\n\n<p>Now, in July 2022, the team is moving the predef documents over to a brand new GitHub organization. The point being to making it more accessible and allow edits and future improvements using standard pull-requests to make ease the maintenance of them.<\/p>\n\n\n\n<p>You find all the documentation here:<\/p>\n\n\n\n<p class=\"has-text-align-center\"><a href=\"https:\/\/github.com\/cpredef\/predef\">https:\/\/github.com\/cpredef\/predef<\/a><\/p>\n\n\n\n<p>If you find errors, mistakes or omissions, we will of course be <em>thrilled<\/em> to see issues and pull requests filed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For C programmers like me, who want to write portable programs that can get built and run on the widest possible array of machines and platforms, we often need to write conditional code. Code that use #ifdefs for particular conditions. Such ifdefs expressions often need to check for a particular compiler, an operating system or &hellip; <a href=\"https:\/\/daniel.haxx.se\/blog\/2022\/07\/13\/predef-is-our-friend\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">predef is our friend<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":5,"featured_media":18919,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[419,178],"class_list":["post-19553","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development","tag-development","tag-portability"],"_links":{"self":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/19553","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/comments?post=19553"}],"version-history":[{"count":7,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/19553\/revisions"}],"predecessor-version":[{"id":19562,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/19553\/revisions\/19562"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/media\/18919"}],"wp:attachment":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/media?parent=19553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/categories?post=19553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/tags?post=19553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}