summaryrefslogtreecommitdiff
path: root/gcc/c-family/c-common.c
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-22 01:46:06 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-22 01:46:06 +0000
commitbd08c370d5a42f544c199e8b7bb49906b2dc0870 (patch)
tree7227251b43d09a6272f8ac01241575b8d81fba52 /gcc/c-family/c-common.c
parentdf4d4b47d309366cebb966065cee6161dce06905 (diff)
downloadgcc-bd08c370d5a42f544c199e8b7bb49906b2dc0870.tar.gz
* c-common.c (get_source_date_epoch): Use int64_t instead of long long.
* gcov-tool.c (profile_rewrite): Use int64_t instead of long long. (do_rewrite): likewise. * line-map.c (location_adhoc_data_update): Use int64_t instead of long long. (get_combined_adhoc_loc): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237676 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family/c-common.c')
-rw-r--r--gcc/c-family/c-common.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 85f3a03146e..8f21fd1ad98 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -12811,7 +12811,7 @@ time_t
cb_get_source_date_epoch (cpp_reader *pfile ATTRIBUTE_UNUSED)
{
char *source_date_epoch;
- long long epoch;
+ int64_t epoch;
char *endptr;
source_date_epoch = getenv ("SOURCE_DATE_EPOCH");
@@ -12819,7 +12819,11 @@ cb_get_source_date_epoch (cpp_reader *pfile ATTRIBUTE_UNUSED)
return (time_t) -1;
errno = 0;
+#if defined(INT64_T_IS_LONG)
+ epoch = strtol (source_date_epoch, &endptr, 10);
+#else
epoch = strtoll (source_date_epoch, &endptr, 10);
+#endif
if (errno != 0 || endptr == source_date_epoch || *endptr != '\0'
|| epoch < 0 || epoch > MAX_SOURCE_DATE_EPOCH)
{