Re: CMake on Unix

Branko Čibej <[email protected]> Mon, 18 May 2026 23:20:01 +0200
Newsgroups gmane.comp.apache.apr.devel
Organization The Apache Software Foundation
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------RQDCbIed13Ho7R5vfJV1cHFP
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 18. 5. 26 22:27, Ivan Zhakov wrote:
> On Mon, 18 May 2026 at 21:24, Timofei Zhakov <[email protected]> wrote:
>
>     On Mon, May 18, 2026 at 5:22 PM Branko Čibej <[email protected]> wrote:
>
>         On 18. 5. 26 17:04, Ivan Zhakov wrote:
>
> [..]
>
>     Yes, especially because the Unix and Win32 versions share a lot of
>     things in common but sometimes need to do it in a slightly
>     different way.
>
>     Also what do you guys think about the fact that Win32 apr.h
>     includes windows.h? It seems odd to me. APR promises to eliminate
>     platform dependence by wrapping everything into POSIX-ish style API
>

Cross-platform API. I'm not sure what you mean by POSIX-ish, but APR 
isn't that.

>     without extra unneeded junk and then all high level code
>     essentially has GetLastError in the scope. I think if one wants to
>     explicitly use win32 API, they should include those headers
>     themselves.
>
>
> It's a good question. I agree that apr.h should not depend on system 
> headers like Windows.h. But one reason that Windows error codes are 
> used in apr_errno.h.

apr.h is a generated, /system-specific/ header. Of course it can and 
should depend on system headers if it needs them. It also includes 
sys/types.h and sys/socket.h and sys/wait.h and os2.h and so on, 
depending on the target. That makes perfect sense.

Sure, if anyone wants to use the Win32 API or a pure POSIX API or the 
Linux API or the macOS API along with APR, they have to include those 
headers /before/ apr.h.

-- Brane



--------------RQDCbIed13Ho7R5vfJV1cHFP
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 18. 5. 26 22:27, Ivan Zhakov wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAPZho0_M2nch+ecugF1wJjvkmb7Z9ZHmxKaqQ6Ogr2zCzo8vtA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">On Mon, 18 May 2026 at 21:24, Timofei Zhakov &lt;<a
            href="mailto:[email protected]" moz-do-not-send="true"
            class="moz-txt-link-freetext">[email protected]</a>&gt;
          wrote:</div>
        <div class="gmail_quote gmail_quote_container">
          <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">On Mon, May 18, 2026 at 5:22 PM Branko
                  Čibej &lt;<a href="mailto:[email protected]"
                    target="_blank" moz-do-not-send="true"
                    class="moz-txt-link-freetext">[email protected]</a>&gt;
                  wrote:</div>
                <div class="gmail_quote">
                  <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                    <div>
                      <div>On 18. 5. 26 17:04, Ivan Zhakov wrote:<br>
                      </div>
                       </div>
                  </blockquote>
                </div>
              </div>
            </div>
          </blockquote>
          <div>[..] </div>
          <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            <div dir="ltr">
              <div dir="ltr">
                <div class="gmail_quote">
                  <div>Yes, especially because the Unix and Win32
                    versions share a lot of things in common but
                    sometimes need to do it in a slightly different way.</div>
                  <div><br>
                  </div>
                  <div>Also what do you guys think about the fact that
                    Win32 apr.h includes windows.h? It seems odd to me.
                    APR promises to eliminate platform dependence by
                    wrapping everything into POSIX-ish style API</div>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
    Cross-platform API. I'm not sure what you mean by POSIX-ish, but APR
    isn't that.<br>
    <br>
    <blockquote type="cite"
cite="mid:CAPZho0_M2nch+ecugF1wJjvkmb7Z9ZHmxKaqQ6Ogr2zCzo8vtA@mail.gmail.com">
      <div dir="ltr">
        <div class="gmail_quote gmail_quote_container">
          <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            <div dir="ltr">
              <div dir="ltr">
                <div class="gmail_quote">
                  <div>without extra unneeded junk and then all high
                    level code essentially has GetLastError in the
                    scope. I think if one wants to explicitly use win32
                    API, they should include those headers themselves.</div>
                </div>
              </div>
            </div>
          </blockquote>
          <br>
        </div>
        <div class="gmail_quote gmail_quote_container">It's a good
          question. I agree that apr.h should not depend on system
          headers like Windows.h. But one reason that Windows error
          codes are used in apr_errno.h.</div>
      </div>
    </blockquote>
    <br>
    apr.h is a generated, <i>system-specific</i> header. Of course it
    can and should depend on system headers if it needs them. It also
    includes sys/types.h and sys/socket.h and sys/wait.h and os2.h and
    so on, depending on the target. That makes perfect sense.<br>
    <br>
    Sure, if anyone wants to use the Win32 API or a pure POSIX API or
    the Linux API or the macOS API along with APR, they have to include
    those headers <i>before</i> apr.h.<br>
    <br>
    -- Brane<br>
    <br>
    <br>
    <br>
  </body>
</html>

--------------RQDCbIed13Ho7R5vfJV1cHFP--