Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ jobs:
include
name: Check public headers

- run: |
# clang loses track of #pragma once headers when it reuses a cached PCH whose headers have
# newer modification times (llvm/llvm-project#239569), so use include guards instead
! grep --recursive --line-number --extended-regexp '^\s*#\s*pragma\s+once' include src test
name: Check for pragma once

Test:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
Expand Down
7 changes: 5 additions & 2 deletions include/cpp/encoding/Ascii.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef CPP_ENCODING_ASCII_HPP
#define CPP_ENCODING_ASCII_HPP

namespace cpp
{
Expand All @@ -21,4 +22,6 @@ namespace cpp
static String decode(cpp::marshal::View<uint8_t> string);
};
}
}
}

#endif
5 changes: 4 additions & 1 deletion include/cpp/encoding/Utf16.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef CPP_ENCODING_UTF16_HPP
#define CPP_ENCODING_UTF16_HPP

namespace cpp
{
Expand All @@ -25,3 +26,5 @@ namespace cpp
};
}
}

#endif
5 changes: 4 additions & 1 deletion include/cpp/encoding/Utf8.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef CPP_ENCODING_UTF8_HPP
#define CPP_ENCODING_UTF8_HPP

namespace cpp
{
Expand All @@ -24,3 +25,5 @@ namespace cpp
};
}
}

#endif
7 changes: 5 additions & 2 deletions include/cpp/marshal/Boxed.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef CPP_MARSHAL_BOXED_HPP
#define CPP_MARSHAL_BOXED_HPP

#include "Definitions.inc"

Expand Down Expand Up @@ -36,4 +37,6 @@ template<class ...TArgs>
inline cpp::marshal::Boxed_obj<T>::Boxed_obj(TArgs... args) : value(std::forward<TArgs>(args)...)
{
setFinaliser(std::is_destructible<T>{});
}
}

#endif
5 changes: 4 additions & 1 deletion include/cpp/marshal/Definitions.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef CPP_MARSHAL_DEFINITIONS_INC
#define CPP_MARSHAL_DEFINITIONS_INC

#include <type_traits>

Expand Down Expand Up @@ -304,3 +305,5 @@ inline cpp::Pointer<T>::Pointer(const ::cpp::marshal::PointerReference<T> ref)
{
ptr = *ref.ptr;
}

#endif
7 changes: 5 additions & 2 deletions include/cpp/marshal/Marshal.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef CPP_MARSHAL_MARSHAL_HPP
#define CPP_MARSHAL_MARSHAL_HPP

#include "Definitions.inc"
#include <cstring>
Expand Down Expand Up @@ -518,4 +519,6 @@ inline void cpp::marshal::Marshal::writeBigEndianFloat64(const View<uint8_t>& vi
#else
writeFloat64(view, value);
#endif
}
}

#endif
7 changes: 5 additions & 2 deletions include/cpp/marshal/PointerReference.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef CPP_MARSHAL_POINTERREFERENCE_HPP
#define CPP_MARSHAL_POINTERREFERENCE_HPP

#include "Definitions.inc"

Expand Down Expand Up @@ -167,4 +168,6 @@ inline T* cpp::marshal::PointerReference<T>::operator->() const
}

return *Super::ptr;
}
}

#endif
7 changes: 5 additions & 2 deletions include/cpp/marshal/PointerType.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef CPP_MARSHAL_POINTERTYPE_HPP
#define CPP_MARSHAL_POINTERTYPE_HPP

#include "Definitions.inc"

Expand Down Expand Up @@ -65,4 +66,6 @@ inline cpp::marshal::PointerType<T>& cpp::marshal::PointerType<T>::operator=(con
value = nullptr;

return *this;
}
}

#endif
7 changes: 5 additions & 2 deletions include/cpp/marshal/RootHandle.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef CPP_MARSHAL_ROOTHANDLE_HPP
#define CPP_MARSHAL_ROOTHANDLE_HPP

#include "Definitions.inc"

Expand Down Expand Up @@ -43,4 +44,6 @@ inline ::Dynamic cpp::marshal::RootHandle::getObject()
inline cpp::Pointer<void> cpp::marshal::RootHandle::toVoidPointer()
{
return object;
}
}

#endif
7 changes: 5 additions & 2 deletions include/cpp/marshal/ValueReference.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef CPP_MARSHAL_VALUEREFERENCE_HPP
#define CPP_MARSHAL_VALUEREFERENCE_HPP

#include "Definitions.inc"

Expand Down Expand Up @@ -137,4 +138,6 @@ inline T cpp::marshal::ValueReference<T>::operator*() const
}

return *Super::ptr;
}
}

#endif
7 changes: 5 additions & 2 deletions include/cpp/marshal/ValueType.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef CPP_MARSHAL_VALUETYPE_HPP
#define CPP_MARSHAL_VALUETYPE_HPP

#include "Definitions.inc"

Expand Down Expand Up @@ -71,4 +72,6 @@ inline cpp::marshal::ValueType<T>& cpp::marshal::ValueType<T>::operator=(const n
::hx::NullReference("ValueType", true);

return *this;
}
}

#endif
5 changes: 4 additions & 1 deletion include/cpp/marshal/View.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef CPP_MARSHAL_VIEW_HPP
#define CPP_MARSHAL_VIEW_HPP

#include <stddef.h>
#include <cpp/Pointer.h>
Expand Down Expand Up @@ -165,3 +166,5 @@ inline T& cpp::marshal::View<T>::operator[](int64_t index) const

return ptr.ptr[index];
}

#endif
7 changes: 5 additions & 2 deletions include/hx/atomic/AtomicInt.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef HX_ATOMIC_ATOMICINT_HPP
#define HX_ATOMIC_ATOMICINT_HPP

#ifndef HXCPP_H
#include <hxcpp.h>
Expand Down Expand Up @@ -30,4 +31,6 @@ namespace hx
Impl* impl;
};
}
}
}

#endif
7 changes: 5 additions & 2 deletions include/hx/atomic/AtomicObject.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef HX_ATOMIC_ATOMICOBJECT_HPP
#define HX_ATOMIC_ATOMICOBJECT_HPP

#ifndef HXCPP_H
#include <hxcpp.h>
Expand Down Expand Up @@ -30,4 +31,6 @@ namespace hx
Impl* impl;
};
}
}
}

#endif
7 changes: 5 additions & 2 deletions include/hx/thread/ConditionVariable.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef HX_THREAD_CONDITIONVARIABLE_HPP
#define HX_THREAD_CONDITIONVARIABLE_HPP

#ifndef HXCPP_H
#include <hxcpp.h>
Expand Down Expand Up @@ -28,4 +29,6 @@ namespace hx
Impl* impl;
};
}
}
}

#endif
7 changes: 5 additions & 2 deletions include/hx/thread/CountingSemaphore.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef HX_THREAD_COUNTINGSEMAPHORE_HPP
#define HX_THREAD_COUNTINGSEMAPHORE_HPP

#ifndef HXCPP_H
#include <hxcpp.h>
Expand All @@ -24,4 +25,6 @@ namespace hx
Impl* impl;
};
}
}
}

#endif
7 changes: 5 additions & 2 deletions include/hx/thread/RecursiveMutex.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef HX_THREAD_RECURSIVEMUTEX_HPP
#define HX_THREAD_RECURSIVEMUTEX_HPP

#ifndef HXCPP_H
#include <hxcpp.h>
Expand All @@ -24,4 +25,6 @@ namespace hx
Impl* impl;
};
}
}
}

#endif
7 changes: 5 additions & 2 deletions include/hx/thread/Scratch.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef HX_THREAD_SCRATCH_HPP
#define HX_THREAD_SCRATCH_HPP

#ifndef HXCPP_H
#include <hxcpp.h>
Expand Down Expand Up @@ -30,4 +31,6 @@ namespace hx
Scratch& operator=(const Scratch& other);
};
}
}
}

#endif
7 changes: 5 additions & 2 deletions include/hx/thread/Thread.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef HX_THREAD_THREAD_HPP
#define HX_THREAD_THREAD_HPP

#ifndef HXCPP_H
#include <hxcpp.h>
Expand Down Expand Up @@ -27,4 +28,6 @@ namespace hx
virtual void setName(const String& name) = 0;
};
}
}
}

#endif
7 changes: 5 additions & 2 deletions include/hx/thread/ThreadLocal.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef HX_THREAD_THREADLOCAL_HPP
#define HX_THREAD_THREADLOCAL_HPP

#ifndef HXCPP_H
#include <hxcpp.h>
Expand All @@ -25,4 +26,6 @@ namespace hx
void set(Dynamic obj);
};
}
}
}

#endif
5 changes: 4 additions & 1 deletion include/hx/zip/Compress.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef HX_ZIP_COMPRESS_HPP
#define HX_ZIP_COMPRESS_HPP

#include "Zip.hpp"

Expand All @@ -17,3 +18,5 @@ namespace hx
};
}
}

#endif
5 changes: 4 additions & 1 deletion include/hx/zip/Uncompress.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef HX_ZIP_UNCOMPRESS_HPP
#define HX_ZIP_UNCOMPRESS_HPP

#include "Zip.hpp"

Expand All @@ -15,3 +16,5 @@ namespace hx
};
}
}

#endif
5 changes: 4 additions & 1 deletion include/hx/zip/Zip.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef HX_ZIP_ZIP_HPP
#define HX_ZIP_ZIP_HPP

#ifndef HXCPP_H
#include <hxcpp.h>
Expand Down Expand Up @@ -36,3 +37,5 @@ namespace hx
};
}
}

#endif
5 changes: 4 additions & 1 deletion src/hx/thread/ThreadImpl.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef HX_THREAD_THREADIMPL_HPP
#define HX_THREAD_THREADIMPL_HPP

#ifndef HXCPP_H
#include <hxcpp.h>
Expand Down Expand Up @@ -58,3 +59,5 @@ namespace hx
};
}
}

#endif
7 changes: 5 additions & 2 deletions src/hx/zip/zlib/ZLibCompress.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef HX_ZIP_ZLIB_ZLIBCOMPRESS_HPP
#define HX_ZIP_ZLIB_ZLIBCOMPRESS_HPP

#include <hxcpp.h>
#include <hx/zip/Compress.hpp>
Expand All @@ -24,4 +25,6 @@ namespace hx
};
}
}
}
}

#endif
Loading
Loading