Skip to content

Conversation

@tbeu
Copy link
Contributor

@tbeu tbeu commented Apr 7, 2015

Where inttypes.h is not availabale for VS<=2012 the MSVC specific macros still can be used.
See #257
@redboltz
Copy link
Contributor

redboltz commented Apr 8, 2015

Hi @tbeu, thank you for sending the PR. I don't get the point yet.

Here is my observation:

  1. MSVC (<=2012) doesn't have inttypes.h
  2. The macros such as PRIu64 are defined in inttypes.h
  3. Hence the macros are not defined in MSVC (<=2012).

Is that correct?

So I wrote some workaround codes in objectc.c

https://github.com/msgpack/msgpack-c/blob/master/src/objectc.c#L127

I assume that if the macros are not provided, fprintf doesn't support the formats corresponding to the macros. If my assumption is correct, even if we define the macros by ourselves, fprintf doesn't recognize the format.

Could you tell me your idea?

@tbeu
Copy link
Contributor Author

tbeu commented Apr 8, 2015

Yes, correct, but MSVC has special format prefixes I64 that can be used instead. This way the (limited) workaround is not used.

@redboltz
Copy link
Contributor

redboltz commented Apr 9, 2015

Aha, I understand now. The format strings that you defined are MSVC extension. I will merge the PR soon.

redboltz added a commit that referenced this pull request Apr 9, 2015
Make use of MSVC specific macros for format specifiers
@redboltz redboltz merged commit dcdc51c into msgpack:master Apr 9, 2015
@tbeu tbeu deleted the Patch-inttypes-on-MSVC branch April 9, 2015 06:35
@tbeu
Copy link
Contributor Author

tbeu commented Apr 9, 2015

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants