Fix test on FreeBSD

google/protobuf/testing/zcgzip.cc:61:25: error: unknown type name 'STDOUT_FILENO'
  FileOutputStream fout(STDOUT_FILENO);
                        ^
google/protobuf/testing/zcgzip.cc:61:24: warning: parentheses were disambiguated as a function declaration [-Wvexing-parse]
  FileOutputStream fout(STDOUT_FILENO);
                       ^~~~~~~~~~~~~~~
google/protobuf/testing/zcgzip.cc:61:25: note: add a pair of parentheses to declare a variable
  FileOutputStream fout(STDOUT_FILENO);
                        ^
                        (
google/protobuf/testing/zcgzip.cc:75:20: error: use of undeclared identifier 'STDIN_FILENO'
    readlen = read(STDIN_FILENO, outptr, outlen);
                   ^
1 warning and 2 errors generated.
gmake[3]: *** [Makefile:4009: google/protobuf/testing/zcgzip.o] Error 1

google/protobuf/testing/zcgunzip.cc:62:23: error: unknown type name 'STDIN_FILENO'
  FileInputStream fin(STDIN_FILENO);
                      ^
google/protobuf/testing/zcgunzip.cc:62:22: warning: parentheses were disambiguated as a function declaration [-Wvexing-parse]
  FileInputStream fin(STDIN_FILENO);
                     ^~~~~~~~~~~~~~
google/protobuf/testing/zcgunzip.cc:62:23: note: add a pair of parentheses to declare a variable
  FileInputStream fin(STDIN_FILENO);
                      ^
                      (
google/protobuf/testing/zcgunzip.cc:74:23: error: use of undeclared identifier 'STDOUT_FILENO'
      int err = write(STDOUT_FILENO, inptr, inlen);
                      ^
1 warning and 2 errors generated.
gmake[3]: *** [Makefile:4009: google/protobuf/testing/zcgunzip.o] Error 1

Reference:	https://bugs.FreeBSD.org/bugzilla/show_bug.cgi?id=215346
		https://svnweb.FreeBSD.org/changeset/ports/428734
This commit is contained in:
Po-Chuan Hsieh 2019-07-13 12:58:36 +00:00 committed by Adam Cozzette
parent 744e799bda
commit 640b932cf8
2 changed files with 2 additions and 0 deletions

View File

@ -42,6 +42,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#ifdef _WIN32
#ifndef STDIN_FILENO

View File

@ -41,6 +41,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#ifdef _WIN32
#ifndef STDIN_FILENO