<commit_before>// mmap64_unix.hpp
//
#pragma once
#ifndef __SDL_MEMORY_MMAP64_UNIX_HPP__
#define __SDL_MEMORY_MMAP64_UNIX_HPP__

#include "dataserver/common/common.h"

#if defined(SDL_OS_UNIX)

#include <sys/mman.h>

namespace sdl { namespace mmap64_detail {

struct substitution_failure {}; // represent a failure to declare something

template<typename T> 
struct substitution_succeeded : std::true_type {};
        
template<>
struct substitution_succeeded<substitution_failure> : std::false_type {};

struct get_mmap64 {
private:
    template<typename X>
    static auto check(X const& x) -> decltype(::mmap64(x, 0, 0, 0, 0, 0));
    static substitution_failure check(...);
public:
    using type = decltype(check(nullptr));
};

template<bool>
struct select_mmap64 {
    template<typename... Values>
    static void * call(Values&&... params) {
        return ::mmap(std::forward<Values>(params)...);
    }
};

template<>
struct select_mmap64<true> {
    template<typename... Values>
    static void * call(Values&&... params) {
        return ::mmap64(std::forward<Values>(params)...);
    }
};

struct has_mmap64: substitution_succeeded<get_mmap64::type> {};

} // mmap64_detail

using mmap64_t = mmap64_detail::select_mmap64<mmap64_detail::has_mmap64::value>;

} // sdl

#endif // #if defined(SDL_OS_UNIX)
#endif // __SDL_MEMORY_MMAP64_UNIX_HPP__<commit_msg>fix linux build : mmap64<commit_after>// mmap64_unix.hpp
//
#pragma once
#ifndef __SDL_MEMORY_MMAP64_UNIX_HPP__
#define __SDL_MEMORY_MMAP64_UNIX_HPP__

#include "dataserver/common/common.h"

#if defined(SDL_OS_UNIX)

#include <sys/mman.h>

namespace sdl { namespace mmap64_detail {

struct substitution_failure {}; // represent a failure to declare something

template<typename T> 
struct substitution_succeeded : std::true_type {};
        
template<>
struct substitution_succeeded<substitution_failure> : std::false_type {};

struct get_mmap64 {
private:
    template<typename X>
    static auto check(X const& x) -> decltype(mmap64(x, 0, 0, 0, 0, 0));
    static substitution_failure check(...);
public:
    using type = decltype(check(nullptr));
};

template<bool>
struct select_mmap64 {
    template<typename... Values>
    static void * call(Values&&... params) {
        return mmap(std::forward<Values>(params)...);
    }
};

template<>
struct select_mmap64<true> {
    template<typename... Values>
    static void * call(Values&&... params) {
        return mmap64(std::forward<Values>(params)...);
    }
};

struct has_mmap64: substitution_succeeded<get_mmap64::type> {};

} // mmap64_detail

using mmap64_t = mmap64_detail::select_mmap64<mmap64_detail::has_mmap64::value>;

} // sdl

#endif // #if defined(SDL_OS_UNIX)
#endif // __SDL_MEMORY_MMAP64_UNIX_HPP__
{'fraction_non_alphanumeric': 0.13638025594149908, 'fraction_numerical': 0.030712979890310785, 'mean_word_length': 4.527272727272727, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 33, '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': '6417628', 'n_tokens_mistral': 1042, 'n_tokens_neox': 947, 'n_words': 188}