<commit_before>//******************************************************************************
//
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
//******************************************************************************

#include "Starboard.h"

#include "CGImageInternal.h"
#include "CGContextInternal.h"
#include "AudioToolbox/AudioToolbox.h"
#include "AVFoundation/AVAudioPlayer.h"
#include "Social/SLServiceTypes.h"
#include "objc/runtime.h"
#include <CommonCrypto/CommonDigest.h>
#include <inttypes.h>
#include <mach/mach.h>
#include <dispatch/dispatch.h>
#include <mutex>
#include <random>

typedef unsigned int mach_port_t;

EbrEvent _applicationStateChanged;
int g_browsersVisible = 0;
UIDeviceOrientation newDeviceOrientation = UIDeviceOrientationUnknown;

static std::mutex s_rngGuard;
static std::mt19937 s_rng;

@interface UIKeyboardRotationView : UIView
@end

@implementation UIKeyboardRotationView
- (UIView*)hitTest:(CGPoint)point withEvent:(UIEvent*)event {
    UIView* ret = [super hitTest:point withEvent:event];

    if (ret == self)
        return nil;

    return ret;
}
@end

@implementation _UISettings
@end

@implementation UIAppearanceSetter
+ (void)_applyAppearance:(UIView*)view {
}
+ (void)_applyAppearance:(UIView*)view withAppearanceClass:(Class)cls withBaseView:(UIView*)baseView {
}
@end

__declspec(dllexport) extern "C" unsigned random() {
    std::lock_guard<std::mutex> lock(s_rngGuard);

    //  The expected range for random() is a value 0->0x7fffffff
    return (s_rng() >> 1);
}

__declspec(dllexport) extern "C" int gettimeofday(struct timeval* tv, void* restrict) {
    EbrTimeval curtime;
    EbrGetTimeOfDay(&curtime);
    tv->tv_sec = curtime.tv_sec;<commit_msg>6621953 - GameKit APIs have Unknown/Gap status.<commit_after>//******************************************************************************
//
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
//******************************************************************************

#include "Starboard.h"

#include "CGImageInternal.h"
#include "CGContextInternal.h"
#include "AudioToolbox/AudioToolbox.h"
#include "AVFoundation/AVAudioPlayer.h"
#include "Social/SLServiceTypes.h"
#include "objc/runtime.h"
#include <CommonCrypto/CommonDigest.h>
#include <inttypes.h>
#include <mach/mach.h>
#include <dispatch/dispatch.h>
#include <mutex>
#include <random>

typedef unsigned int mach_port_t;

EbrEvent _applicationStateChanged;
int g_browsersVisible = 0;
UIDeviceOrientation newDeviceOrientation = UIDeviceOrientationUnknown;

static std::mutex s_rngGuard;
static std::mt19937 s_rng;

@interface UIKeyboardRotationView : UIView
@end

@implementation UIKeyboardRotationView
- (UIView*)hitTest:(CGPoint)point withEvent:(UIEvent*)event {
    UIView* ret = [super hitTest:point withEvent:event];

    if (ret == self)
        return nil;

    return ret;
}
@end

@implementation _UISettings
@end

@implementation UIAppearanceSetter
+ (void)_applyAppearance:(UIView*)view {
}
+ (void)_applyAppearance:(UIView*)view withAppearanceClass:(Class)cls withBaseView:(UIView*)baseView {
}
@end

@implementation _UILoading
+ (void)hideLoadingScreen {
}
@end

bool isSupportedControllerOrientation(id controller, UIInterfaceOrientation orientation) {
    return false;
}

__declspec(dllexport) extern "C" unsigned random() {
    std::lock_guard<std::mutex> lock(s_rngGuard);

    //  The expected range for random() is a value 0->0x7fffffff
    return (s_rng() >> 1);
}

__declspec(dllexport) extern "C" int gettimeofday(struct timeval* tv, void* restrict) {
    EbrTimeval curtime;
    EbrGetTimeOfDay(&curtime);
    tv->tv_sec = curtime.tv_sec;
{'fraction_non_alphanumeric': 0.16628175519630484, 'fraction_numerical': 0.007348309888725593, 'mean_word_length': 5.455284552845528, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '1970959', 'n_tokens_mistral': 1476, 'n_tokens_neox': 1392, 'n_words': 419}