Skip to content

Commit

Permalink
port: avoid warnings with zlib of Conda with CLang
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Nov 22, 2021
1 parent c5f5169 commit ec99d90
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
2 changes: 1 addition & 1 deletion port/cpl_minizip_unzip.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ extern "C" {
#endif

#ifndef _ZLIB_H
#include <zlib.h>
#include "cpl_zlib_header.h" // to avoid warnings when including zlib.h
#endif

#ifndef CPL_MINIZIP_IOAPI_H_INCLUDED
Expand Down
2 changes: 1 addition & 1 deletion port/cpl_minizip_zip.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ extern "C" {
#endif

#ifndef _ZLIB_H
#include "zlib.h"
#include "cpl_zlib_header.h" // to avoid warnings when including zlib.h
#endif

#ifndef CPL_MINIZIP_IOAPI_H_INCLUDED
Expand Down
2 changes: 1 addition & 1 deletion port/cpl_vsil_gzip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
#if HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <zlib.h>
#include "cpl_zlib_header.h" // to avoid warnings when including zlib.h

#ifdef HAVE_LIBDEFLATE
#include "libdeflate.h"
Expand Down
38 changes: 38 additions & 0 deletions port/cpl_zlib_header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/******************************************************************************
*
* Project: GDAL
* Purpose: Includes zlib header
* Author: Even Rouault <even dot rouault at spatialys dot com>
*
******************************************************************************
* Copyright (c) 201, Even Rouault <even dot rouault at spatialys dot com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*****************************************************************************/

#ifndef CPL_ZLIB_HEADER_H
#define CPL_ZLIB_HEADER_H

#if defined(__GNUC__) && !defined(_MSC_VER)
#pragma GCC system_header
#endif

#include "zlib.h"

#endif

0 comments on commit ec99d90

Please sign in to comment.