rework ifdef header protection #456

Move all content inside of the header ifdef checks.  There's
no need to have the C++ checks and includes outside of them.
master
Mike Frysinger 2018-08-31 01:21:34 -04:00
parent c9c4f0ed53
commit 4fc6d8a0d6
9 changed files with 42 additions and 53 deletions

View File

@ -1,3 +1,6 @@
#ifndef BMP_H
#define BMP_H 1
#ifdef __cplusplus
extern "C" {
#endif
@ -18,9 +21,6 @@ extern "C" {
----------------------------------------------------------------------------
*/
#ifndef BMP_H
#define BMP_H 1
#define BMP_PALETTE_3 1
#define BMP_PALETTE_4 2
@ -104,8 +104,8 @@ extern "C" {
} bmp_info_t;
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,11 +1,11 @@
#ifdef __cplusplus
extern "C" {
#endif
#ifndef GD_H
#define GD_H 1
#include <stdlib.h>
#ifndef GD_H
#define GD_H 1
#ifdef __cplusplus
extern "C" {
#endif
/* Version information. This gets parsed by build scripts as well as
* gcc so each #define line in this group must also be splittable on
@ -94,11 +94,6 @@ extern "C" {
#endif
#endif
#ifdef __cplusplus
extern "C"
{
#endif
/* gd.h: declarations file for the graphic-draw module.
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
@ -1634,16 +1629,11 @@ BGD_DECLARE(int) gdReleaseVersion(void);
BGD_DECLARE(const char *) gdExtraVersion(void);
BGD_DECLARE(const char *) gdVersionString(void);
#ifdef __cplusplus
}
#endif
/* newfangled special effects */
#include "gdfx.h"
#endif /* GD_H */
#ifdef __cplusplus
}
#endif
#endif /* GD_H */

View File

@ -1,12 +1,12 @@
#ifdef __cplusplus
extern "C" {
#endif
#ifndef GD_IO_H
#define GD_IO_H 1
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef VMS
# define Putchar gdPutchar
#endif
@ -93,8 +93,8 @@ int gdGetIntLSB(signed int *result, gdIOCtx *ctx);
int gdSeek(gdIOCtx *ctx, const int offset);
long gdTell(gdIOCtx *ctx);
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -26,9 +26,9 @@
}
gdImageDestroy(im_in);
*/
#ifdef __cplusplus
#ifndef _gd_io_stream_h
#define _gd_io_stream_h
#ifdef __cplusplus
#include "gd.h"
#include <iostream>
@ -121,5 +121,5 @@ inline gdIOCtx * gdNewOstreamCtx (std::ostream * __stream)
return new ostreamIOCtx(* __stream);
}
#endif /* _gd_io_stream_h */
#endif /* __cplusplus */
#endif /* _gd_io_stream_h */

View File

@ -1,10 +1,10 @@
#ifndef GDFX_H
#define GDFX_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef GDFX_H
#define GDFX_H 1
BGD_DECLARE(gdImagePtr) gdImageSquareToCircle(gdImagePtr im, int radius);
BGD_DECLARE(char *) gdImageStringFTCircle(
@ -22,9 +22,8 @@ BGD_DECLARE(char *) gdImageStringFTCircle(
BGD_DECLARE(void) gdImageSharpen (gdImagePtr im, int pct);
#endif /* GDFX_H */
#ifdef __cplusplus
}
#endif
#endif /* GDFX_H */

View File

@ -1,10 +1,10 @@
#ifndef GDHELPERS_H
#define GDHELPERS_H 1
#ifdef __cplusplus
extern "C" {
#endif
#ifndef GDHELPERS_H
#define GDHELPERS_H 1
/* sys/types.h is needed for size_t on Sparc-SunOS-4.1 */
#ifndef _WIN32_WCE
#include <sys/types.h>
@ -69,8 +69,8 @@ extern "C" {
#define DPI2DPCM(dpi) (unsigned int)((dpi)/2.54 + 0.5)
#define DPI2DPM(dpi) (unsigned int)((dpi)/0.0254 + 0.5)
#endif /* GDHELPERS_H */
#ifdef __cplusplus
}
#endif
#endif /* GDHELPERS_H */

View File

@ -19,9 +19,9 @@
im.Gif(out);
}
*/
#ifdef __cplusplus
#ifndef _gdpp_h
#define _gdpp_h
#ifdef __cplusplus
#ifdef HAVE_CONFIG_H
#include "config.h"
@ -1541,5 +1541,5 @@ protected:
/// Read in an image from a standard library input stream
std::istream & operator>> (std::istream & in, GD::Image & img);
#endif /* _gdpp_h */
#endif /* __cplusplus */
#endif /* _gdpp_h */

View File

@ -1,9 +1,9 @@
#ifndef JISX0208_H
#define JISX0208_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JISX0208_H
#define JISX0208_H
/* This file was derived from "src/VF_Ftype.c" in VFlib2-2.24.2
by Dr. Kakugawa */
@ -1299,8 +1299,8 @@ extern "C" {
}
};
#endif /* JISX0208_H */
#ifdef __cplusplus
}
#endif
#endif /* JISX0208_H */

View File

@ -1,7 +1,3 @@
#ifdef __cplusplus
extern "C" {
#endif
/* WBMP
* ----
* WBMP Level 0: B/W, Uncompressed
@ -16,6 +12,10 @@ extern "C" {
#ifndef __WBMP_H
#define __WBMP_H 1
#ifdef __cplusplus
extern "C" {
#endif
/* WBMP struct
* -----------
* A Wireless bitmap structure
@ -44,8 +44,8 @@ extern "C" {
void freewbmp(Wbmp *wbmp);
void printwbmp(Wbmp *wbmp);
#endif
#ifdef __cplusplus
}
#endif
#endif