commit 68069cf6014c5bd18aba4f3fa754c793c6740b3d from: Thomas Adam date: Wed Mar 08 09:27:14 2023 UTC portable: fixes for NetBSD * Move the main incldue/got_compat.h to the top of the files they're included in. * Define SHA256Init and friends to the system equivalents. commit - d3f1e38b5d5c7188a56b8b08d472ff8683c10e15 commit + 68069cf6014c5bd18aba4f3fa754c793c6740b3d blob - 7824fa9a867cfb43694e08cb4617069d28d9e5ca blob + 356d4183db0c1a3595729548617393b185bfed4e --- include/got_compat2.h +++ include/got_compat2.h @@ -212,6 +212,9 @@ typedef struct _SHA2_CTX { u_int64_t bitcount[2]; u_int8_t buffer[SHA512_BLOCK_LENGTH]; } SHA2_CTX; +#endif + +#if defined(__APPLE__) || defined(__NetBSD__) #define SHA256Init SHA256_Init #define SHA256Update SHA256_Update #define SHA256Final SHA256_Final blob - 3235b8c431f5d9fe37b29f4e87c953e2c0b1b380 blob + 89562361089d480759e5366d089156845be28b49 --- lib/deflate.c +++ lib/deflate.c @@ -14,6 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "got_compat.h" + #include #include @@ -23,7 +25,6 @@ #include #include -#include "got_compat.h" #include "got_error.h" #include "got_object.h" #include "got_path.h" blob - c886d1a285863fa2148b2b295b733d08fe7c9040 blob + 37b7f2b63c9f5a8e3a7ccee3cd4d60d698ef7c22 --- lib/diff_myers.c +++ lib/diff_myers.c @@ -16,6 +16,8 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include "got_compat.h" #include #include blob - f024469b941b3c0d551b8050cdb33fe296707d8f blob + 428751fa19345e93f294c2c9ee5ecf5052092a35 --- lib/diffreg.c +++ lib/diffreg.c @@ -14,6 +14,8 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include "got_compat.h" #include #include @@ -23,8 +25,6 @@ #include #include #include - -#include "got_compat.h" #include "got_object.h" #include "got_opentemp.h" blob - 714ead9c490fd270970c36841073e3b242f0a005 blob + 72130751b2d228dbd5ee224857661dc3217d263f --- lib/hash.c +++ lib/hash.c @@ -14,6 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "got_compat.h" + #include #include @@ -23,8 +25,6 @@ #include #include -#include "got_compat.h" - #include "got_object.h" #include "got_lib_hash.h" blob - 3dff610bd701189b93bfd4157175df7ada64b2fb blob + a59c766edfa1a6912c2c7c02cc0d66b896bba049 --- lib/inflate.c +++ lib/inflate.c @@ -14,6 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "got_compat.h" + #include #include @@ -25,7 +27,6 @@ #include #include -#include "got_compat.h" #include "got_error.h" #include "got_object.h" #include "got_path.h"