The compiler does not support #pragma once
2 answers
You can use guardonce to convert statements #pragma once
to standard #ifndef ...
include guard.
The following worked for me:
cd /tmp
git clone https://github.com/thrust/thrust.git
git clone https://github.com/cgmb/guardonce.git
cd guardonce
git checkout v2.0.0
python -m guardonce.once2guard -r "/tmp/thrust/thrust/"
This creates included guards in every thrust header file:
git diff /tmp/thrust
--- a/thrust/adjacent_difference.h
+++ b/thrust/adjacent_difference.h
@@ -19,7 +19,8 @@
* \brief Compute difference between consecutive elements of a range
*/
-#pragma once
+#ifndef ADJACENT_DIFFERENCE_H
+#define ADJACENT_DIFFERENCE_H
. . .
+2
source to share