add MOZ_CONSTEXPR_VAR

RESOLVED FIXED in mozilla25

Status

()

RESOLVED FIXED
5 years ago
2 years ago

People

(Reporter: tbsaunde, Assigned: tbsaunde)

Tracking

unspecified
mozilla25
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Some compilers don't like things like
static const constexpr foo = bar;
other compilers don't support constexpr at all so we don't want to just do
static MOZ_CONSTEXPR foo = bar;
so lets add MOZ_CONSTEXPR_VAR that is constexpr if that is supported and otherwise const.
(Assignee)

Comment 1

5 years ago
Created attachment 769193 [details] [diff] [review]
bug 888493 - add MOZ_CONSTEXPR_VAR and use it in jsrc/ion/ some
Attachment #769193 - Flags: review?(jwalden+bmo)

Comment 2

5 years ago
Comment on attachment 769193 [details] [diff] [review]
bug 888493 - add MOZ_CONSTEXPR_VAR and use it in jsrc/ion/ some

Review of attachment 769193 [details] [diff] [review]:
-----------------------------------------------------------------

::: mfbt/Attributes.h
@@ +129,3 @@
>  #else
>  #  define MOZ_CONSTEXPR         /* no support */
> +#  define MOZ_CONSTEXPR_VAR         const

Since everything else here is aligned, keep the const/constexpr aligned with the constexpr/no-support comment above each.
Attachment #769193 - Flags: review?(jwalden+bmo) → review+
Backed out in http://hg.mozilla.org/integration/mozilla-inbound/rev/7d6d824067ea

https://tbpl.mozilla.org/php/getParsedLog.php?id=24946713&tree=Mozilla-Inbound if you like it Linux-flavored, https://tbpl.mozilla.org/php/getParsedLog.php?id=24946587&tree=Mozilla-Inbound if you like it Windows flavored, everyone agreed that they had no idea what MOZ_THIS_IN_INITIALIZER_LIST you were talking about.
(Assignee)

Comment 5

5 years ago
it looks like somehow a hunk remove the this initializer think magically appeared in the patch!?! so I removed that and pushed again
remote:   https://hg.mozilla.org/integration/mozilla-inbound/rev/040df3280d8c
https://hg.mozilla.org/mozilla-central/rev/040df3280d8c
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Depends on: 1277775
You need to log in before you can comment on or make changes to this bug.