[compiler-rt] r198647 - Only include inttypes.h on platforms for which PRIu64 isn't in stdint.h

Justin Bogner mail at justinbogner.com
Mon Jan 6 17:42:00 PST 2014


These both seem wrong (at least, they break on darwin12+) and the
original change should be correct. I'm going to revert these so I can
understand what was failing to prompt these.

Kaelyn Uhrain <rikka at google.com> writes:
> Author: rikka
> Date: Mon Jan  6 17:37:31 2014
> New Revision: 198647
>
> URL: http://llvm.org/viewvc/llvm-project?rev=198647&view=revLog:
> Only include inttypes.h on platforms for which PRIu64 isn't in stdint.h
>
> Modified:
>     compiler-rt/trunk/lib/profile/PGOProfiling.c
>
> Modified: compiler-rt/trunk/lib/profile/PGOProfiling.c
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/PGOProfiling.c?rev=198647&r1=198646&r2=198647&view=diff==============================================================================
> --- compiler-rt/trunk/lib/profile/PGOProfiling.c (original)
> +++ compiler-rt/trunk/lib/profile/PGOProfiling.c Mon Jan  6 17:37:31 2014
> @@ -7,10 +7,13 @@
>  |*
>  \*===----------------------------------------------------------------------===*/
>  
> -#include <inttypes.h>
>  #include <stdio.h>
>  #include <stdlib.h>
>  
> +#if !defined(__APPLE__)
> +#include <inttypes.h>
> +#endif
> +
>  #ifndef _MSC_VER
>  #include <stdint.h>
>  #else
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Kaelyn Uhrain <rikka at google.com> writes:

> Author: rikka
> Date: Mon Jan  6 18:29:19 2014
> New Revision: 198650
>
> URL: http://llvm.org/viewvc/llvm-project?rev=198650&view=revLog:
> Explicitly enable PRIu64 by defining __STDC_FORMAT_MACROS if it isn't
> yet defined.
>
> Modified:
>     compiler-rt/trunk/lib/profile/PGOProfiling.c
>
> Modified: compiler-rt/trunk/lib/profile/PGOProfiling.c
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/PGOProfiling.c?rev=198650&r1=198649&r2=198650&view=diff==============================================================================
> --- compiler-rt/trunk/lib/profile/PGOProfiling.c (original)
> +++ compiler-rt/trunk/lib/profile/PGOProfiling.c Mon Jan  6 18:29:19 2014
> @@ -10,6 +10,12 @@
>  #include <stdio.h>
>  #include <stdlib.h>
>  
> +// Explicitly request that the format macros like PRIu64 be enabled if they
> +// haven't already been enabled.
> +#ifndef __STDC_FORMAT_MACROS
> +#define __STDC_FORMAT_MACROS 1
> +#endif
> +
>  #if !defined(__APPLE__)
>  #include <inttypes.h>
>  #endif
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list