[nanomsg] Legacy environments?

  • From: "Garrett D'Amore" <garrett@xxxxxxxxxx>
  • To: "nanomsg@xxxxxxxxxxxxx" <nanomsg@xxxxxxxxxxxxx>
  • Date: Wed, 13 Apr 2016 17:28:44 -0700

I’m looking at some of the code, and there are some annoyances that I’d
rather not deal with.  One of these is that I’d like to be able to have an
API to report 64-bit values back to the application (statistics).  But
there isn’t a “portable” prior to C99 to provide 64-bit values.  (You can
define a structure with two 32-bit values, but that’s annoying.)

So, for various reasons it would be nice if I could start to make
assumptions that are more typical of modern environments (where modern is
anything produced this century.)

So, my question is:

a) Do you use nanomsg in environments where a C99 compiler is unavailable?
 (That is, do you have to work with legacy ANSI C / C90.  Note that we
don’t support K&R in libnanomsg.)

b) Do you use nanomsg where <stdint.h> is missing?

c) Do you use nanomsg in environments where no definition of uint64_t
exists?  (I suspect that the answer to this is *no*, because *internally*
libnanomsg uses some uint64_t types.)

The easiest thing for me to do would be to just #include <stdint.h> and use
uint64_t — though note that the C and POSIX standards don’t require
platforms without 64-bit support to have this type.

Note that versions of Visual studio prior to 2010 did *not* include
stdint.h, but a suitable replacement is here:
https://msinttypes.googlecode.com/svn/trunk/stdint.h

  - Garrett

Other related posts: