google / sandboxed-api

Generate sandboxes for C/C++ libraries automatically
https://developers.google.com/sandboxed-api/
Apache License 2.0
1.65k stars 189 forks source link

ZStandard: Use flags from absl #107

Closed oshogbo closed 2 years ago

oshogbo commented 2 years ago

I'm not sure how this change happened as in my code it was pointing to the right header.

We can't use here the one from sapi as there is a conflict in the headers:

[9/10] Building CXX object example/CMakeFiles/sapi_minizstd.dir/main.cc.o
In file included from _deps/absl-src/absl/flags/internal/parse.h:23,
                 from _deps/absl-src/absl/flags/parse.h:29,
                 from /home/oshogbo/sapi-zstd/contrib/zstd/sandboxed.h:25,
                 from ../example/main.cc:24:
_deps/absl-src/absl/flags/declare.h:63: warning: "ABSL_DECLARE_FLAG" redefined
   63 | #define ABSL_DECLARE_FLAG(type, name)                        \
      | 
In file included from /home/oshogbo/sapi-zstd/contrib/zstd/sandboxed.h:24,
                 from ../example/main.cc:24:
/home/oshogbo/sapi-zstd/sandboxed_api/util/flag.h:23: note: this is the location of the previous definition
   23 | #define ABSL_DECLARE_FLAG(type, name) DECLARE_##type(name)
      | 

This change is Reviewable

oshogbo commented 2 years ago

contrib/zstd/sandboxed.h, line 24 at r1 (raw file):

Previously, okunz (Oliver Kunz) wrote…
This header file doesn't use absl::Flags, I'm assuming you're referring to example/main.cc:60? Google's C++ style doesn't rely on transitive inclusions, see https://google.github.io/styleguide/cppguide.html#Include_What_You_Use

I mean I'm happy to move it but in different PR I was asked to move it here: https://reviewable.io/reviews/google/sandboxed-api/100#-MutldPd4TWOT713MUEz