<commit_before>--- misc/liblangtag-0.4.0/liblangtag/lt-macros.h
+++ misc/build/liblangtag-0.4.0/liblangtag/lt-macros.h
@@ -14,7 +14,9 @@
 #error "Only <liblangtag/langtag.h> can be included directly."
 #endif
 
+#ifndef _WIN32
 #include <sys/param.h>
+#endif
 
 #ifndef __LT_MACROS_H__
 #define __LT_MACROS_H__
@@ -206,6 +206,14 @@
 
 LT_BEGIN_DECLS
 
+#ifdef _MSC_VER
+#ifdef _M_AMD64
+typedef signed long long ssize_t;
+#else
+typedef signed int ssize_t;
+#endif
+#endif
+
 typedef void *		lt_pointer_t;
 typedef int		lt_bool_t;
 typedef lt_pointer_t (* lt_copy_func_t)	(lt_pointer_t data);
--- misc/liblangtag-0.4.0/liblangtag/lt-atomic.h
+++ misc/build/liblangtag-0.4.0/liblangtag/lt-atomic.h
@@ -17,7 +17,11 @@
 #include "config.h"
 #endif
 
+#if !defined(LT_HAVE_ATOMIC_BUILTINS) && !defined(_WIN32)
 #include <pthread.h>
+#elif defined(_WIN32)
+#include <windows.h>
+#endif
 #include "lt-messages.h"
 
 LT_BEGIN_DECLS
@@ -26,14 +30,40 @@
 LT_INLINE_FUNC int       lt_atomic_int_inc         (volatile int *v);
 LT_INLINE_FUNC lt_bool_t lt_atomic_int_dec_and_test(volatile int *v);
 
-#ifndef LT_HAVE_ATOMIC_BUILTINS
+#if !defined(LT_HAVE_ATOMIC_BUILTINS) && !defined(_WIN32)
 static pthread_mutex_t __lt_atomic_lock = PTHREAD_MUTEX_INITIALIZER;
 #endif
 
 /*< private >*/
 
 /*< public >*/
-#ifdef LT_HAVE_ATOMIC_BUILTINS
+#ifdef _WIN32
+LT_INLINE_FUNC int
+lt_atomic_int_get(volatile int *v)
+{
+       lt_return_val_if_fail (v != NULL, 0);
+
+       return (int)InterlockedExchangeAdd((LONG*)v, 0);
+}
+
+LT_INLINE_FUNC int
+lt_atomic_int_inc(volatile int *v)
+{
+       lt_return_val_if_fail (v != NULL, 0);
+
+       return (int)InterlockedExchangeAdd((LONG*)v, 1) + 1;
+}
+
+lt_bool_t
+lt_atomic_int_dec_and_test(volatile int *v)
+{
+       lt_return_val_if_fail (v != NULL, FALSE);
+
+       return 1 == InterlockedExchangeAdd((LONG*)v, -1) - 1;
+}
+
+
+#elif defined(LT_HAVE_ATOMIC_BUILTINS)
 LT_INLINE_FUNC int
 lt_atomic_int_get(volatile int *v)
 {
--- misc/liblangtag-0.4.0/liblangtag/lt-messages.h
+++ misc/build/liblangtag-0.4.0/liblangtag/lt-messages.h
@@ -298,10 +298,17 @@
 	_lt_return_after_eval_if_fail(__expr__,__eval__)<commit_msg>corrected Windows lt_atomic_int_dec_and_test()<commit_after>--- misc/liblangtag-0.4.0/liblangtag/lt-macros.h
+++ misc/build/liblangtag-0.4.0/liblangtag/lt-macros.h
@@ -14,7 +14,9 @@
 #error "Only <liblangtag/langtag.h> can be included directly."
 #endif
 
+#ifndef _WIN32
 #include <sys/param.h>
+#endif
 
 #ifndef __LT_MACROS_H__
 #define __LT_MACROS_H__
@@ -206,6 +206,14 @@
 
 LT_BEGIN_DECLS
 
+#ifdef _MSC_VER
+#ifdef _M_AMD64
+typedef signed long long ssize_t;
+#else
+typedef signed int ssize_t;
+#endif
+#endif
+
 typedef void *		lt_pointer_t;
 typedef int		lt_bool_t;
 typedef lt_pointer_t (* lt_copy_func_t)	(lt_pointer_t data);
--- misc/liblangtag-0.4.0/liblangtag/lt-atomic.h
+++ misc/build/liblangtag-0.4.0/liblangtag/lt-atomic.h
@@ -17,7 +17,11 @@
 #include "config.h"
 #endif
 
+#if !defined(LT_HAVE_ATOMIC_BUILTINS) && !defined(_WIN32)
 #include <pthread.h>
+#elif defined(_WIN32)
+#include <windows.h>
+#endif
 #include "lt-messages.h"
 
 LT_BEGIN_DECLS
@@ -26,14 +30,40 @@
 LT_INLINE_FUNC int       lt_atomic_int_inc         (volatile int *v);
 LT_INLINE_FUNC lt_bool_t lt_atomic_int_dec_and_test(volatile int *v);
 
-#ifndef LT_HAVE_ATOMIC_BUILTINS
+#if !defined(LT_HAVE_ATOMIC_BUILTINS) && !defined(_WIN32)
 static pthread_mutex_t __lt_atomic_lock = PTHREAD_MUTEX_INITIALIZER;
 #endif
 
 /*< private >*/
 
 /*< public >*/
-#ifdef LT_HAVE_ATOMIC_BUILTINS
+#ifdef _WIN32
+LT_INLINE_FUNC int
+lt_atomic_int_get(volatile int *v)
+{
+       lt_return_val_if_fail (v != NULL, 0);
+
+       return (int)InterlockedExchangeAdd((LONG*)v, 0);
+}
+
+LT_INLINE_FUNC int
+lt_atomic_int_inc(volatile int *v)
+{
+       lt_return_val_if_fail (v != NULL, 0);
+
+       return (int)InterlockedExchangeAdd((LONG*)v, 1) + 1;
+}
+
+lt_bool_t
+lt_atomic_int_dec_and_test(volatile int *v)
+{
+       lt_return_val_if_fail (v != NULL, FALSE);
+
+       return 0 == (InterlockedExchangeAdd((LONG*)v, -1) - 1);
+}
+
+
+#elif defined(LT_HAVE_ATOMIC_BUILTINS)
 LT_INLINE_FUNC int
 lt_atomic_int_get(volatile int *v)
 {
--- misc/liblangtag-0.4.0/liblangtag/lt-messages.h
+++ misc/build/liblangtag-0.4.0/liblangtag/lt-messages.h
@@ -298,10 +298,17 @@
 	_lt_return_after_eval_if_fail(__expr__,__eval__)
{'fraction_non_alphanumeric': 0.15228893489763054, 'fraction_numerical': 0.035886818495514144, 'mean_word_length': 4.71353482260184, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4999609', 'n_tokens_mistral': 2056, 'n_tokens_neox': 1842, 'n_words': 303}