Skip to content

Commit

Permalink
define GLOB_TILDE in fileutil.cc (ampproject#33304)
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 361882155

Co-authored-by: Googler <[email protected]>
  • Loading branch information
antiphoton and Googler authored Mar 16, 2021
1 parent f3c2e7e commit eadd345
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions validator/cpp/htmlparser/fileutil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@
#include "defer.h"
#include "strings.h"

// TODO(caoboxiao)
// The Macro `GLOB_TILDE` is not defined in the WebAssembly environment because
// WebAssembly does not have the file system, so we have to define this MACRO in
// order to have this file successfully compiled in WebAssembly. The side
// effects is minimized because this is a cc file not an h file. In fact, the
// WebAssembly module never calls the glob function, so it is better to split
// fileutil.cc into two files, and the WebAssembly module will only depend on
// the one without glob funcitons.
#ifndef GLOB_TILDE
#define GLOB_TILDE (1 << 12)
#endif

namespace htmlparser {

std::string FileUtil::FileContents(std::string_view filepath) {
Expand Down

0 comments on commit eadd345

Please sign in to comment.