{"id":2230,"date":"2011-12-04T11:18:00","date_gmt":"2011-12-04T09:18:00","guid":{"rendered":"http:\/\/www.final-memory.org\/?p=2230"},"modified":"2011-12-04T11:18:00","modified_gmt":"2011-12-04T09:18:00","slug":"stdint-h-and-stdbool-h-for-keil-c51","status":"publish","type":"post","link":"https:\/\/www.final-memory.org\/?p=2230","title":{"rendered":"stdint.h and stdbool.h for Keil C51"},"content":{"rendered":"<p>Interestingly, <a href=\"http:\/\/www.keil.com\/c51\/\" target=\"_blank\">Keil C51<\/a> does not ship with C99 compliant stdint.h and stdbool.h header files.<\/p>\n<p>But there is no need to dispair. The stdint.h from <a href=\"http:\/\/sdcc.sourceforge.net\/\" target=\"_blank\">SDCC<\/a> seems to work ok however I personally would not trust the pointer types and widths. However in a context of a 8051 MCU, I&#8217;d rather introduce my own data type for pointers anyway due to the different possible memory spaces. A generic pointer will have to carry section information that has to be evaluated at runtime. A special typed pointer won&#8217;t waste as many resources.<\/p>\n<p>The stdbool.h from SDCC can be used as well. Just make sure to be Keil compatible and use the following definitions:<\/p>\n<p><code> #define _Bool bit<br \/>\n#define BOOL  bit<br \/>\n#define bool  _Bool<br \/>\n#define __bool_true_false_are_defined 1<br \/>\n<\/code><\/p>\n<div id=\"facebook_like\"><iframe src=\"http:\/\/www.facebook.com\/plugins\/like.php?href=https%3A%2F%2Fwww.final-memory.org%2F%3Fp%3D2230&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;font=segoe+ui&amp;colorscheme=light&amp;height=80\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:500px; height:80px;\" allowTransparency=\"true\"><\/iframe><\/div>","protected":false},"excerpt":{"rendered":"<p>Interestingly, Keil C51 does not ship with C99 compliant stdint.h and stdbool.h header files. But there is no need to dispair. The stdint.h from SDCC seems to work ok however I personally would not trust the pointer types and widths. However in a context of a 8051 MCU, I&#8217;d rather introduce my own data type &hellip; <a href=\"https:\/\/www.final-memory.org\/?p=2230\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;stdint.h and stdbool.h for Keil C51&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,76,27,74,35,36],"tags":[],"class_list":["post-2230","post","type-post","status-publish","format-standard","hentry","category-34","category-ansi-c","category-asm-software","category-embedded-systems","category-mikrocontroller","category-sdcc"],"_links":{"self":[{"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/posts\/2230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.final-memory.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2230"}],"version-history":[{"count":2,"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/posts\/2230\/revisions"}],"predecessor-version":[{"id":2232,"href":"https:\/\/www.final-memory.org\/index.php?rest_route=\/wp\/v2\/posts\/2230\/revisions\/2232"}],"wp:attachment":[{"href":"https:\/\/www.final-memory.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.final-memory.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.final-memory.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}