Newsgroups: comp.lang.c, comp.arch.embedded
From: tomto...@village.uunet.be (Tom Torfs)
Date: 26 Feb 2004 07:36:35 -0800
Local: Thurs, Feb 26 2004 10:36 am
Subject: Binary constant macros
Hello All,
I've been missing the lack of support for binary numeric literals in whatever = B8(10101010); and will translate as: whatever = 85; (compile-time constant) Code below... hopefully it's useful to some of you as well. greetings, /* Binary constant generator macro /* All macro's evaluate to compile-time constants */ /* *** helper macros *** / /* turn a numeric literal into a hex constant /* 8-bit conversion function */ /* *** user macros *** / /* for upto 8-bit binary constants */ /* for upto 16-bit binary constants, MSB first */ /* for upto 32-bit binary constants, MSB first */ /* Sample usage: greetings, You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
