Skip to content

Commit

Permalink
Merge pull request #47 from pierre-dejoue/pragma-once
Browse files Browse the repository at this point in the history
Replace header guards by pragma once
  • Loading branch information
jhasse authored May 9, 2022
2 parents 54af704 + 505f63d commit d6ecda3
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 33 deletions.
5 changes: 1 addition & 4 deletions poly2tri/common/dll_symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef DLL_SYMBOL_H
#define DLL_SYMBOL_H
#pragma once

#if defined(_WIN32)
# define P2T_COMPILER_DLLEXPORT __declspec(dllexport)
Expand All @@ -52,5 +51,3 @@
# define P2T_DLL_SYMBOL P2T_COMPILER_DLLIMPORT
# endif
#endif

#endif
6 changes: 1 addition & 5 deletions poly2tri/common/shapes.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

// Include guard
#ifndef SHAPES_H
#define SHAPES_H
#pragma once

#include "dll_symbol.h"

Expand Down Expand Up @@ -329,5 +327,3 @@ inline void Triangle::IsInterior(bool b)
P2T_DLL_SYMBOL bool IsDelaunay(const std::vector<p2t::Triangle*>&);

}

#endif
5 changes: 1 addition & 4 deletions poly2tri/common/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef UTILS_H
#define UTILS_H
#pragma once

// Otherwise #defines like M_PI are undeclared under Visual Studio
#define _USE_MATH_DEFINES
Expand Down Expand Up @@ -129,5 +128,3 @@ bool InScanArea(const Point& pa, const Point& pb, const Point& pc, const Point&
}

}

#endif
5 changes: 1 addition & 4 deletions poly2tri/poly2tri.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef POLY2TRI_H
#define POLY2TRI_H
#pragma once

#include "common/shapes.h"
#include "sweep/cdt.h"

#endif
5 changes: 1 addition & 4 deletions poly2tri/sweep/advancing_front.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef ADVANCED_FRONT_H
#define ADVANCED_FRONT_H
#pragma once

#include "../common/shapes.h"

Expand Down Expand Up @@ -114,5 +113,3 @@ inline void AdvancingFront::set_search(Node* node)
}

}

#endif
5 changes: 1 addition & 4 deletions poly2tri/sweep/cdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef CDT_H
#define CDT_H
#pragma once

#include "advancing_front.h"
#include "sweep_context.h"
Expand Down Expand Up @@ -103,5 +102,3 @@ class P2T_DLL_SYMBOL CDT
};

}

#endif
5 changes: 1 addition & 4 deletions poly2tri/sweep/sweep.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
* "FlipScan" Constrained Edge Algorithm invented by Thomas Åhlén, [email protected]
*/

#ifndef SWEEP_H
#define SWEEP_H
#pragma once

#include <vector>

Expand Down Expand Up @@ -281,5 +280,3 @@ class Sweep
};

}

#endif
5 changes: 1 addition & 4 deletions poly2tri/sweep/sweep_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef SWEEP_CONTEXT_H
#define SWEEP_CONTEXT_H
#pragma once

#include <list>
#include <vector>
Expand Down Expand Up @@ -183,5 +182,3 @@ inline Point* SweepContext::tail() const
}

}

#endif

0 comments on commit d6ecda3

Please sign in to comment.