gdabah / distorm

Powerful Disassembler Library For x86/AMD64
Other
1.26k stars 238 forks source link

dont ask; dont tell #164

Closed sfinktah closed 3 years ago

gdabah commented 3 years ago

Why do we care to use it if it's there on the expense of more code? Wondering about the need.

sfinktah commented 3 years ago

a) To avoid cases of: "Conflicting definition of uint32_t; previously defined in distorm.h"

b) Generally: it's a standard, and who are you to go redefining standards?

c) Because by not including the MSVC version, _STDINT is also not being defined, which may effect the way your code is built (the future is a long time).

d) Your definition may not be as suitable as Microsoft's for some yet-to-be-introduced hardware platform.

The same could be achieved with less code by putting the check higher -- with the earlier #if _MSCVER check that prevents stdint from being included in the first place.

Most people's solution would be to just remove all trace of the manually defined stdint variables and presume that the user was using a compiler that wasn't 15 years out of date.

BTW, kudos... Although I have been using MSVC since at least Y2K, I never learned enough to realize I why stdint.h was important or what it's absence meant (other than pointless adjustments to ported unix code). Oh dear, I just remembered I used to use Borland C++ when I was younger, which had this slew of silly small types for everything... oh horror.

By "15 years out of date" I am not impugning TCC. That's not out of date, as there are no new releases of it. (Though QuickJS is another Fabrice miracle that I only just found).

sfinktah commented 3 years ago

better included as part of https://github.com/gdabah/distorm/pull/167