Skip to content

Conversation

@trofi
Copy link

@trofi trofi commented Aug 2, 2024

Without the change woff2 build fails on upcoming gcc-15 as:

In file included from src/woff2_out.cc:9:
include/woff2/output.h:73:25: error: expected ')' before '*' token
   73 |   WOFF2MemoryOut(uint8_t* buf, size_t buf_size);
      |                 ~       ^
      |                         )
include/woff2/output.h:79:3: error: 'uint8_t' does not name a type
   79 |   uint8_t* buf_;
      |   ^~~~~~~
include/woff2/output.h:16:1: note: 'uint8_t' is defined in header '<cstdint>';
  this is probably fixable by adding '#include <cstdint>'
   15 | #include <string>
  +++ |+#include <cstdint>
   16 |

#include <algorithm>
#include <cstring>
#include <memory>
#include <stdint.h>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Changed to the following:

--- a/include/woff2/output.h
+++ b/include/woff2/output.h
@@ -9,10 +9,11 @@
 #ifndef WOFF2_WOFF2_OUT_H_
 #define WOFF2_WOFF2_OUT_H_

+#include <stdint.h>
+
 #include <algorithm>
 #include <cstring>
 #include <memory>
-#include <stdint.h>
 #include <string>

 namespace woff2 {

Without the change `woff2` build fails on upcoming `gcc-15` as:

    In file included from src/woff2_out.cc:9:
    include/woff2/output.h:73:25: error: expected ')' before '*' token
       73 |   WOFF2MemoryOut(uint8_t* buf, size_t buf_size);
          |                 ~       ^
          |                         )
    include/woff2/output.h:79:3: error: 'uint8_t' does not name a type
       79 |   uint8_t* buf_;
          |   ^~~~~~~
    include/woff2/output.h:16:1: note: 'uint8_t' is defined in header '<cstdint>';
      this is probably fixable by adding '#include <cstdint>'
       15 | #include <string>
      +++ |+#include <cstdint>
       16 |
@trofi trofi force-pushed the gcc-15-stdint-fix branch from 3905a7d to 08ece78 Compare December 12, 2024 11:39
@trofi trofi requested a review from atetubou December 12, 2024 11:39
@atetubou
Copy link

@rsheeter could you merge this? This is also necessary for chromium build experimenting C++ modules.

@philwo
Copy link
Member

philwo commented Jan 22, 2025

@rsheeter Friendly ping - could you please have a look? It would help us a lot, thank you! 😊

aarongable pushed a commit to chromium/chromium that referenced this pull request Jan 24, 2025
This is to fix build error when we set use_libcxx_modules=true.

I made this as local modification due to the owner of woff2 doesn't
respond to merge google/woff2#176.

Bug: 40263312
Change-Id: Ie0e35f3b60382c278a9fccdc0b7de4db55447acc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6196756
Reviewed-by: Kenichi Ishibashi <[email protected]>
Commit-Queue: Kenichi Ishibashi <[email protected]>
Auto-Submit: Takuto Ikuta <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1410760}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants