Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Issue 103293003: Add build_config_functions.h to avoid #ifdef (Closed)

Created:
7 years ago by jln (very slow on Chromium)
Modified:
7 years ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, agl, jln+watch_chromium.org, Jeffrey Yasskin
Visibility:
Public.

Description

Add build_config_functions.h to avoid #ifdef An "#ifdef" statement is more confusing than using C++ syntax and "if (XXX)". They should be used only when strictly necessary (i.e. when code cannot compile). For the cases where #ifdef are not strictly necessary, these new helpers can be used. Thanks to compiler optimization, the final compiled code will be the same when these helpers are used instead of #ifdef. R=rsesek@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=239079

Patch Set 1 #

Total comments: 9

Patch Set 2 : Address nits #

Patch Set 3 : Use namespace build. #

Total comments: 2

Patch Set 4 : Rename Arm to ARM #

Patch Set 5 : Use build_config.h exclusively. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+118 lines, -23 lines) Patch
M build/build_config.h View 1 chunk +3 lines, -0 lines 0 comments Download
A build/build_config_functions.h View 1 2 3 4 1 chunk +110 lines, -0 lines 0 comments Download
M sandbox/linux/seccomp-bpf/bpf_tests.h View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M sandbox/linux/tests/unit_tests.h View 1 chunk +0 lines, -5 lines 0 comments Download
M sandbox/linux/tests/unit_tests.cc View 1 chunk +0 lines, -16 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
jln (very slow on Chromium)
Robert: please take a look. I've been pondering having a common prefix for all of ...
7 years ago (2013-12-04 00:55:21 UTC) #1
Robert Sesek
On 2013/12/04 00:55:21, jln wrote: > Robert: please take a look. > > I've been ...
7 years ago (2013-12-04 18:41:22 UTC) #2
jln (very slow on Chromium)
https://codereview.chromium.org/103293003/diff/1/build/build_config_functions.h File build/build_config_functions.h (right): https://codereview.chromium.org/103293003/diff/1/build/build_config_functions.h#newcode7 build/build_config_functions.h:7: // binary will look the same when using these. ...
7 years ago (2013-12-04 20:37:35 UTC) #3
jln (very slow on Chromium)
Will: I think Robert is right that this would better live in base. WDYT? Also ...
7 years ago (2013-12-04 20:39:19 UTC) #4
jln (very slow on Chromium)
Adding Jeffrey as well. Jeffrey, feel free to punt if you're busy, but your expertise ...
7 years ago (2013-12-04 20:41:16 UTC) #5
willchan no longer on Chromium
So build/ is lower level than base/ (i.e. base/ can depend on build/, as seen ...
7 years ago (2013-12-04 21:44:45 UTC) #6
Robert Sesek
On 2013/12/04 21:44:45, willchan wrote: > So build/ is lower level than base/ (i.e. base/ ...
7 years ago (2013-12-04 21:46:43 UTC) #7
jln (very slow on Chromium)
On 2013/12/04 21:46:43, rsesek wrote: > I was braindead and read "build/" as "base/". Maybe ...
7 years ago (2013-12-04 22:23:23 UTC) #8
jln (very slow on Chromium)
(also, I've removed content/common/sandbox_seccomp_bpf_linux.cc from this CL because there are too many pending CL with ...
7 years ago (2013-12-04 22:24:09 UTC) #9
Robert Sesek
https://codereview.chromium.org/103293003/diff/1/build/build_config_functions.h File build/build_config_functions.h (right): https://codereview.chromium.org/103293003/diff/1/build/build_config_functions.h#newcode7 build/build_config_functions.h:7: // binary will look the same when using these. ...
7 years ago (2013-12-05 14:51:45 UTC) #10
jln (very slow on Chromium)
> Yes, so I worry that extensive use of these may mean products ship dead ...
7 years ago (2013-12-05 18:34:54 UTC) #11
Jeffrey Yasskin
On Thu, Dec 5, 2013 at 10:34 AM, <jln@chromium.org> wrote: >> Yes, so I worry ...
7 years ago (2013-12-05 18:39:03 UTC) #12
Robert Sesek
LGTM then
7 years ago (2013-12-05 20:37:02 UTC) #13
jln (very slow on Chromium)
https://codereview.chromium.org/103293003/diff/30001/build/build_config_functions.h File build/build_config_functions.h (right): https://codereview.chromium.org/103293003/diff/30001/build/build_config_functions.h#newcode90 build/build_config_functions.h:90: inline bool IsArchitectureArm() { On 2013/12/05 14:51:46, rsesek wrote: ...
7 years ago (2013-12-05 23:37:24 UTC) #14
jln (very slow on Chromium)
Committed patchset #5 manually as r239079 (presubmit successful).
7 years ago (2013-12-06 00:07:01 UTC) #15
jam
hmm, it seems unfortunate to now have two ways of doing this, and two different ...
7 years ago (2013-12-06 00:09:25 UTC) #16
jln (very slow on Chromium)
On 2013/12/06 00:09:25, jam wrote: > hmm, it seems unfortunate to now have two ways ...
7 years ago (2013-12-06 00:13:56 UTC) #17
jam
On 2013/12/06 00:13:56, jln wrote: > On 2013/12/06 00:09:25, jam wrote: > > hmm, it ...
7 years ago (2013-12-06 00:20:11 UTC) #18
darin (slow to review)
Is there code outside of sandbox/linux/ where you intend to use these functions? We typically ...
7 years ago (2013-12-06 04:48:23 UTC) #19
jln (very slow on Chromium)
On 2013/12/06 04:48:23, darin wrote: > Is there code outside of sandbox/linux/ where you intend ...
7 years ago (2013-12-06 04:57:52 UTC) #20
jln (very slow on Chromium)
7 years ago (2013-12-06 08:52:23 UTC) #21
Message was sent while issue was closed.
A revert of this CL has been created in
https://chromiumcodereview.appspot.com/108013002/ by jln@chromium.org.

The reason for reverting is: http://goo.gl/3ufXOJ.

Powered by Google App Engine
This is Rietveld 408576698