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 <functional> | |
#include <iostream> | |
// Detect whether the function takes an int argument or zero arguments | |
template<typename T, typename = decltype(std::declval<T>()(0))> std::true_type detect_type(const T&); | |
template<typename T, typename = decltype(std::declval<T>()())> std::false_type detect_type(const T&); | |
int main() | |
{ | |
auto a = std::bind([](int){}, std::placeholders::_1); // Prints 1 |
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 "native_client/src/shared/imc/nacl_imc_c.h" | |
#include <stdio.h> | |
#include <string.h> | |
#include <errno.h> | |
#define SEL_LDR "tools/sel_ldr_x86_64" | |
#define IRT "tools/irt_core_x86_64.nexe" | |
#define APP "a.nexe" | |
#define NACL_HANDLE_TRANSFER_PROTOCOL 0xd3c0de01 |
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
#ifdef _WIN32 | |
#include <windows.h> | |
#else | |
#include <unistd.h> | |
#include <sys/mman.h> | |
#include <sys/wait.h> | |
#include <signal.h> | |
#endif | |
#include <stdio.h> | |
#include <string.h> |
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
class VM { | |
public: | |
protected: | |
virtual void Syscall(int32_t index, Reader& input, Writer& output) = 0; | |
void DoRPC(const Writer& input, Reader& output); | |
private: | |
NaCl::Module* module; | |
}; |
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 T> class BasicStringRef { | |
BasicStringRef(const std::basic_string<T>& other) | |
{ | |
ptr = other.c_str(); | |
len = other.size(); | |
} | |
BasicStringRef(const T* other) | |
{ | |
ptr = other; | |
len = std::char_traits<T>::length(other); |
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
/* | |
=========================================================================== | |
Daemon GPL Source Code | |
Copyright (C) 2013 Unvanquished Developers | |
This file is part of the Daemon GPL Source Code (Daemon Source Code). | |
Daemon Source Code is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by |
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) 2013 Amanieu d'Antras | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in |
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
#!/usr/bin/python3 | |
import sys | |
import os.path | |
import struct | |
IDENT = "IDP3" | |
VERSION = 15 | |
f = "" | |
def printUsage(): |
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
diff --git a/src/common/IPC.h b/src/common/IPC.h | |
index cab883f..d1fcaee 100644 | |
--- a/src/common/IPC.h | |
+++ b/src/common/IPC.h | |
@@ -209,7 +209,7 @@ template<> struct SerializeTraits<std::string> { | |
}; | |
// IPC message, which automatically serializes and deserializes objects | |
-template<typename... T> class Message { | |
+template<uint32_t Major, uint32_t Minor, typename... T> class Message { |
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
diff --git a/src/common/IPC.h b/src/common/IPC.h | |
index c3dbc5c..38778a1 100644 | |
--- a/src/common/IPC.h | |
+++ b/src/common/IPC.h | |
@@ -46,9 +46,86 @@ Maryland 20850 USA. | |
#include "../engine/qcommon/q_shared.h" | |
#include "../engine/qcommon/qcommon.h" | |
+namespace IPC { | |
+ |
OlderNewer