Do you want to run this by chromium-dev and embedder-dev? Run it by a larger audience, make sure no one can think of anything preventing it from happening, give a heads-up to everyone downstream.On Thu, Aug 5, 2021 at 6:54 PM Xiaohan Wang (王消寒) <xhw...@chromium.org> wrote:I think we reached consensus in the design doc so I'll move forward with the plan.On Mon, Aug 2, 2021 at 12:50 PM Xiaohan Wang (王消寒) <xhw...@chromium.org> wrote:As a reminder, we are considering replacing defined(OS_WIN) with BUILDFLAG(IS_WIN), the design doc has more detailed discussion. The prototype CL is here and the work is tracked in https://bugs.chromium.org/p/chromium/issues/detail?id=1234043. Thoughts and insights are welcome!If there's no objections, I'll clean up the prototype CL and start working on this (by following the implementation plan in the doc).On Thu, Jul 29, 2021 at 10:55 PM Bruce Dawson <bruce...@google.com> wrote:The set of possible errors with the current setup is, apparently, endless. For instance, until recently PRESUBMIT.py would check that you had included build_config.h but it didn't actually check that you included it before using the defines. That led to errors like this one.It is a lot of churn to change how this works, but it seems like a reasonable idea.On Thursday, July 29, 2021 at 9:48:07 AM UTC-7 pb...@chromium.org wrote:FWIW, from the sidelines I like this. This also saves us from typos like defined(OS_WINDWS).On Thu, Jul 29, 2021 at 7:58 AM <dan...@chromium.org> wrote:On Wed, Jul 28, 2021 at 8:30 PM Xiaohan Wang (王消寒) <xhw...@chromium.org> wrote:I played with it a bit more and my recommendation is BUILDFLAG(IS_WIN). I wrote a short design doc on why I came up with this, and the plan I have in mind. The prototype CL is here. Please take a look and let me know what you think.Also, what's the process to get such a design doc approved? Consensus on this thread?Let's involve chromium-dev for best visibility. Let's ensure the owners of the flags agree and see if any one raises any breaking concerns.--On Wed, Jul 28, 2021 at 10:09 AM Xiaohan Wang (王消寒) <xhw...@chromium.org> wrote:I filed https://bugs.chromium.org/p/chromium/issues/detail?id=1234043 to track the discussion/work.On Wed, Jul 28, 2021 at 8:25 AM Xiaohan Wang (王消寒) <xhw...@chromium.org> wrote:Will do. Thanks!On Tue, Jul 27, 2021 at 8:25 PM Avi Drissman <a...@google.com> wrote:I'd recommend coding it up as a proof of concept and once you have it working, float a proposal around.On Tue, Jul 27, 2021 at 10:30 PM Xiaohan Wang (王消寒) <xhw...@chromium.org> wrote:Thanks for the extra explanation!So it seems BUILDFLAG(OS_WIN) would be the easiest and most consistent way then. It's only two letters more than defined(OS_WIN) so the length isn't too bad.On Tue, Jul 27, 2021 at 7:00 PM Avi Drissman <a...@google.com> wrote:My prototype was impossible to implement specifically because it was something like `OS(WIN)`. The problem was that a lot of the values inside the parentheses were already defined by the preprocessor and wrecked the token pasting games we were playing.We need to have full control of the symbols we use, and that is what precluded my approach.AviOn Tue, Jul 27, 2021 at 9:10 PM Xiaohan Wang (王消寒) <xhw...@chromium.org> wrote:In Avi's prototype, the plan is to introduce something like `OS(WIN)` instead of `defined(OS_WIN)`. I like the brevity of `OS(WIN)` , but agree `BUILDFLAG(OS_WIN)` is more consistent, and is probably easier to implement. Does anyone have any preferences?On Tue, Jul 27, 2021 at 1:34 PM Joe Mason <joenot...@google.com> wrote:+1 to BUILDFLAG(OS_WIN). Reusing BUILDFLAG means fewer concepts to remember than having another similar macro.(Unless there are semantic differences between OS_ macros and BUILDFLAG that I haven't thought of. Remembering how BUILDFLAG(OS_FOO) differs from BUILDFLAG(FOO) would be even worse.)On Mon, Jul 26, 2021 at 11:11 PM 'Will Cassella' via cxx <c...@chromium.org> wrote:Ah true. I'd be in favor of something like `BUILDFLAG(OS_WIN)` then, or `BUILD_OS_WIN()`--On Monday, July 26, 2021 at 7:34:58 PM UTC-7 dch...@chromium.org wrote:The advantage to using a macro function is that it will fail to build if the correct header that defines the macro function is not included; without the macro function, the block would just silently be not compiled.DanielOn Mon, 26 Jul 2021 at 19:31, 'Will Cassella' via cxx <c...@chromium.org> wrote:Would it have to be an invocated macro like that? Why not just something like `#if BUILD_OS_WIN`?--On Monday, July 26, 2021 at 1:16:43 PM UTC-7 Xiaohan Wang wrote:Thanks for the context. I don't know what it entails but I am interested in giving it a try :)On Mon, Jul 26, 2021 at 11:45 AM 'Avi Drissman' via cxx <c...@chromium.org> wrote:As soon as I found that bare os strings, like XXXX(LINUX), wouldn't work, I abandoned it. If you want to propose a change, go for it, but there isn't anything here specifically to resume.--On Mon, Jul 26, 2021 at 2:36 PM Xiaohan Wang (王消寒) <xhw...@chromium.org> wrote:The presubmit only applies to things prefixed with OS, my typo is like "OH_WIN" :)I am glad I am not alone here. Is there a plan to resume this work? I wonder whether I can help.On Mon, Jul 26, 2021 at 11:22 AM Avi Drissman <a...@google.com> wrote:The CL in which I tried to make OS(xxxx) happen (equivalent to your proposal) was https://crrev.com/c/2288751. I don't have current memories of why it didn't work.On Mon, Jul 26, 2021 at 2:16 PM Avi Drissman <a...@google.com> wrote:We have a presubmit to try to catch those issues, so I'm curious why that didn't fire for you.I was the last one to change build_config.h, and specifically tried to get BUILDFLAG working for OSes, and ran into fundamental blockers that prevented it from happening, though I can’t find my notes and the info is paged out of my head.AviOn Mon, Jul 26, 2021 at 2:06 PM Xiaohan Wang <xhw...@chromium.org> wrote:Hello,I had a typo in `defined(OS_WIN)` that wasn't caught during testing and code review. I wonder whether it makes sense to convert to use BUILDFLAGs so it's easier to catch similar issues, something like `BUILDFLAG(OS_WIN)`?Thanks!--Best,Xiaohan
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/37a04d37-bf51-4643-bc9d-7cc6efc6bbdfn%40chromium.org.
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CACWgwAZ%3D1fyKOA9w7QJaBzFCfYXgFR4uhgbngSLES75Brw-bOg%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/b9a6459f-fdc0-431c-8692-992e671405can%40chromium.org.
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/ca1ebabc-803a-43d1-9acf-8a73882bebfan%40chromium.org.
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAF1j9YO5ohotHxjvm69igDwJqwPEno-cTSVTrC4ahafrEuDYqw%40mail.gmail.com.
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAHtyhaQ5V6kpYOj0uKr0cQXH2_3uOfie3D3pTUawjhGgbK8sBA%40mail.gmail.com.
#include "build/buildflag.h"
#if defined(OS_WIN)
#define BUILDFLAG_INTERNAL_IS_WIN() (1)
#else
#define BUILDFLAG_INTERNAL_IS_WIN() (0)
#endif
......
- There might still be some defined(OS_XXX) left in third_party/ repos, which I'll leave to owners to decide.