This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* \file | |
* Trace and log functions and macros | |
*/ | |
// Licensed under the MIT License <http://opensource.org/licenses/MIT>. | |
// SPDX-License-Identifier: MIT | |
// Copyright (c) 2007 - 2023 Vladimir Ivanov <knebekaizer@gmail.com>. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T1, typename T2> | |
typename std::enable_if<std::is_same<T1,T2>::value, bool>::type | |
test(T1 a = {}, T2 b = {}) { | |
log_trace << "Not implemented, or template parameter types are not supported: " | |
"T1: " << typeid(T1).name() << "; T2: " << typeid(T2).name(); | |
return false; | |
} | |
template <typename T1, typename T2> | |
typename std::enable_if<!std::is_same<T1,T2>::value, bool>::type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) | |
{ | |
int i, j, n; | |
for (i = 0; i < 11; i++) { | |
for (j = 0; j < 10; j++) { | |
n = 10 * i + j; | |
if (n > 108) break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# output binary | |
BIN := x | |
# source files | |
SRCS := \ | |
x.c | |
# files included in the tarball generated by 'make dist' (e.g. add LICENSE file) | |
DISTFILES := $(BIN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <bool retainAutorelease> | |
static ALWAYS_INLINE id Kotlin_ObjCExport_refToObjCImpl(ObjHeader* obj) { | |
if (obj == nullptr) return nullptr; | |
if (obj->has_meta_object()) { | |
id associatedObject = GetAssociatedObject(obj); | |
if (associatedObject != nullptr) { | |
return retainAutorelease ? objc_retainAutoreleaseReturnValue(associatedObject) : associatedObject; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Also, please write good git commit messages. A good commit message | |
looks like this: | |
Header line: explain the commit in one line (use the imperative) | |
Body of commit message is a few lines of text, explaining things | |
in more detail, possibly giving some background about the issue | |
being fixed, etc etc. | |
The body of the commit message can be several paragraphs, and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/#include <thread> | |
#include <future> | |
#include <iostream> | |
#include <chrono> | |
#include <vector> | |
#include <array> | |
#include <cassert> | |
#include <cstdlib> // _Exit() "stdlib.h" | |
#include <unistd.h> // sleep() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2009-2017, Farooq Mela | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: | |
* | |
* 1. Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. | |
* 2. Redistributions in binary form must reproduce the above copyright |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace clng { | |
// All the types below are POD and bitwise compatible with corresponding clang classes | |
struct PointerIntPair { | |
intptr_t Value = 0; | |
}; | |
struct QualType { | |
PointerIntPair Value; // llvm::PointerIntPair<llvm::PointerUnion<const Type *, const ExtQuals *>, Qualifiers::FastWidth> Value; | |
}; |