Commit 73d36d59 authored by Karl Wette's avatar Karl Wette
Browse files

Replacement for using #pragma {} in C++-include protection

- #pragma {} were used to match curly brackets with
  extern "C" {}, so that text editors would not indent
  the entire header file due to the surrounding { }s
- However this use of #pragma, when compiling with -Wall,
  generates a lot of "ignoring #pragma {}" warnings.
  These can be turned off, but this in turn might hide
  some other strange use of #pragma somewhere else.
- The replacement instead uses #if 0 to skip compiling
  the matching bracket, and should never generate warnings
Original: 2302493cc7ab927a589d2e7c59b7c5b72afafcf0
parent 24ecc7ee
......@@ -43,9 +43,10 @@
#include <lal/LALDatatypes.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
#ifdef __cplusplus
......@@ -499,8 +500,9 @@ LALCOMPLEX16VectorFFT (
#undef RESTRICT
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -44,9 +44,10 @@
#include <lal/LALDatatypes.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
#ifdef __cplusplus
......@@ -907,8 +908,9 @@ LALREAL8VectorFFT(
#undef RESTRICT
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -66,9 +66,10 @@
#include <lal/RealFFT.h>
#include <lal/Window.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
NRCSID( TIMEFREQFFTH, "$Id$" );
......@@ -460,8 +461,9 @@ XLALPSDRegressorSetPSD(
unsigned weight
);
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -101,9 +101,10 @@ signiatures of the digitization.
#include <lal/LALStdlib.h>
#include <lal/Random.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
NRCSID( INJECTH, "$Id$" );
......@@ -158,8 +159,9 @@ LALSSInjectTimeSeries( LALStatus *,
REAL4TimeSeries *output,
REAL4TimeSeries *signalvec );
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -26,9 +26,10 @@
#include <lal/LALRCSID.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
NRCSID(LALSIMULATIONH, "$Id:");
......@@ -55,8 +56,9 @@ int XLALSimAddInjectionREAL8TimeSeries(
const COMPLEX16FrequencySeries *response
);
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -258,9 +258,10 @@ f/\dot{f}$ (provided $\tau\gg1/f$, as we have assumed).
#include <lal/SkyCoordinates.h>
#include <lal/LALBarycenter.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
NRCSID( SIMULATECOHERENTGWH, "$Id$" );
......@@ -410,8 +411,9 @@ LALSimulateCoherentGW( LALStatus *status,
%\newpage\input{SimulateCoherentGWTestC}
</lalLaTeX> */
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -69,9 +69,10 @@ fully LAL-compliant and use only LAL types, so they are included in
#include <lal/LALStdlib.h>
#include <lal/LALStdio.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
NRCSID( STRINGINPUTH, "$Id$");
......@@ -243,8 +244,9 @@ LALStringToZ( LALStatus *status, COMPLEX16 *value, const CHAR *string, CHAR **en
void
LALStringToGPS( LALStatus *status, LIGOTimeGPS *value, const CHAR *string, CHAR **endptr );
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -117,9 +117,10 @@
NRCSID( XLALERRORH, "$Id$" );
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
......@@ -458,8 +459,9 @@ void XLALError(
#define XLAL_ERROR_REAL8( func, errnum ) \
XLAL_ERROR_VAL( func, errnum, XLAL_REAL8_FAIL_NAN )
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -39,9 +39,10 @@
NRCSID( AUDIOH, "$Id$" );
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
/** Records a time series as a .wav audio file */
......@@ -56,8 +57,9 @@ int XLALAudioAURecordREAL4TimeSeries( FILE *fp, REAL4TimeSeries *series );
/** Records a time series as a .au audio file */
int XLALAudioAURecordREAL8TimeSeries( FILE *fp, REAL8TimeSeries *series );
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -154,9 +154,10 @@
#include <stdlib.h>
#include <lal/LALStdlib.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
......@@ -222,8 +223,9 @@ LALMathNDPlot( LALStatus *status,
INT4 *ntiles,
REAL4 *pointSize );
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -55,9 +55,10 @@ a frequency series.
#include <lal/LALDatatypes.h>
#include <lal/Date.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
......@@ -97,8 +98,9 @@ void LALReadNoiseSpectrum(
</lalLaTeX> */
#endif
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -47,9 +47,10 @@ Further documentation is given in the individual routines' modules.
#include <lal/IIRFilter.h>
#include <lal/ZPGFilter.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
NRCSID(BANDPASSTIMESERIESH,"$Id$");
......@@ -146,8 +147,9 @@ LALDButterworthREAL4TimeSeries( LALStatus *status,
\newpage\input{BandPassTestC}
</lalLaTeX> */
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -109,9 +109,10 @@ routines never actually use this coefficient.
#include <lal/LALStdlib.h>
#include <lal/ZPGFilter.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
NRCSID(IIRFILTERH,"$Id$");
......@@ -281,8 +282,9 @@ LALDIIRFilterREAL4VectorR( LALStatus *status,
\newpage\input{IIRFilterTestC}
</lalLaTeX> */
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -81,9 +81,10 @@ variable is assumed.
#include <lal/LALStdlib.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
NRCSID(ZPGFILTERH,"$Id$");
......@@ -157,8 +158,9 @@ void
LALWToZCOMPLEX16ZPGFilter( LALStatus *status,
COMPLEX16ZPGFilter *filter );
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -41,9 +41,10 @@
NRCSID (CALIBRATIONH,"$Id$");
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma } /** to match the previous brace **/
#elif 0
} /* so that editors will match preceding brace */
#endif
/**** <lalLaTeX>
......@@ -363,8 +364,9 @@ int XLALUpsample(REAL8TimeSeries *uphR, REAL8TimeSeries *hR, int up_factor);
int XLALUpsampleLinear(REAL8TimeSeries *uphR, REAL8TimeSeries *hR, int up_factor);
#ifdef __cplusplus
#pragma { /** to match the next brace **/
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -30,9 +30,10 @@ $Id$
#include <lal/SkyCoordinates.h>
#include <lal/IIRFilter.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
NRCSID( COHERENTESTIMATION, "$Id$" );
......@@ -104,8 +105,9 @@ LALClearCoherentInfo (
CoherentEstimation *dat
);
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -25,9 +25,10 @@
NRCSID (COMPUTE_DATA_QUALITY_VECTORH,"$Id$");
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma } /** to match the previous brace **/
#elif 0
} /* so that editors will match preceding brace */
#endif
int XLALComputeDQ(REAL4* sv_data, int r_sv,
......@@ -39,8 +40,9 @@ int XLALComputeDQ(REAL4* sv_data, int r_sv,
#ifdef __cplusplus
#pragma { /** to match the next brace **/
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -27,9 +27,10 @@
#include <lal/LALDatatypes.h>
#include <lal/LALRCSID.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
NRCSID(FREQUENCYSERIESH, "$Id:");
......@@ -64,8 +65,9 @@ include(FrequencySeriesH.m4)
define(`DATATYPE',UINT8)
include(FrequencySeriesH.m4)
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -46,9 +46,10 @@
#ifndef _RESAMPLETIMESERIES_H
#define _RESAMPLETIMESERIES_H
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
NRCSID( RESAMPLETIMESERIESH, "$Id$" );
......@@ -177,8 +178,9 @@ LALResampleREAL4TimeSeries(
ResampleTSParams *params
);
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif
......
......@@ -127,9 +127,10 @@ Also all segments in a segment list can be time-shifted using \c XLALSegListShif
#include <lal/LALDatatypes.h>
#include <lal/XLALError.h>
#ifdef __cplusplus
#if defined(__cplusplus)
extern "C" {
#pragma }
#elif 0
} /* so that editors will match preceding brace */
#endif
/** \cond DONT_DOXYGEN */
......@@ -227,8 +228,9 @@ XLALSegListKeep( LALSegList *seglist, const LIGOTimeGPS *start, const LIGOTimeG
/** \endcond */
/*----------------------- Trailer stuff ----------------------------*/
#ifdef __cplusplus
#pragma {
#if 0
{ /* so that editors will match succeeding brace */
#elif defined(__cplusplus)
}
#endif /* C++ protection. */
#endif /* Double-include protection. */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment