Allan Odgaard
39ec2d008c
Revert "Use thread_local instead of our own implementation"
...
Unfortunately Xcode 8 and Xcode 8.1 both produce an unstable executable.
This reverts commit 1658d6356a .
2016-11-13 16:22:04 +07:00
Ronald Wampler
a5323b4f77
Add oak::random_shuffle algorithm
2016-10-18 23:06:49 +02:00
Ronald Wampler
1f84a3d09f
Add random header as a precompiled header
2016-10-18 23:06:49 +02:00
Allan Odgaard
182d4aa140
Add oak::has_prefix for comparing std::string with string literal
2016-10-17 11:03:41 +02:00
Ronald Wampler
1658d6356a
Use thread_local instead of our own implementation
...
Apple's clang (Apple LLVM version 8.0.0 (clang-800.0.24.1)) as shipped with Xcode 8 now supports `thread_local`. This effectively reverts commits: 14c6a70 f3d1aba 9d1d1a1a and 172ce9d .
2016-09-15 07:17:52 +02:00
Allan Odgaard
46fb745bbe
Use perrorf when printing errors with dynamic strings
...
Also revise error messages to be more consistent.
2016-08-28 17:25:26 +02:00
Allan Odgaard
fe301508c8
Introduce perrorf as shorthand for fprintf with strerror
2016-08-28 17:25:19 +02:00
Allan Odgaard
dbdfa3c6af
Add identifying information to perror output
2016-08-21 12:09:30 +02:00
Allan Odgaard
a415576827
Disable deprecation warning for Gestalt API
...
The replacement API¹ did not appear until the 10.10 SDK, although it might be usable from 10.9.2, but as we currently support 10.8, we cannot use it.
¹ [[NSProcessInfo processInfo] operatingSystemVersion]
2016-07-05 10:45:02 +02:00
Allan Odgaard
96508d81c3
Remove unused function (os_tuple)
2016-06-22 20:44:41 +02:00
Allan Odgaard
437f640e74
Implement move assignment and constructor for oak::basic_tree_t
2016-06-20 18:19:13 +02:00
Allan Odgaard
8e8a647e25
Add algorithm to erase descendent keys form a std::map
...
This can be used when the key is name spaced, e.g. `/foo/bar` or `foo.bar`. Here we can erase everything under foo by using `/foo/` or `foo.` respectively.
2016-06-02 21:07:43 +02:00
Ronald Wampler
00a20aefb6
Revert "Disable unused-local-typedef warning for sparsehash"
...
This reverts commit 2c6ad9b391 .
Upstream released a new version, which resolved the warnings this commit meant to suppress.
2015-10-22 16:27:40 +07:00
Ronald Wampler
2c6ad9b391
Disable unused-local-typedef warning for sparsehash
...
Also, disable unknown-pragmas warning for older version of clang.
2015-08-11 21:01:07 +02:00
Ronald Wampler
f3d1abaeca
Introduce tls_ptr_t
...
This is a lightweight wrapper around the pthread methods to access thread local memory.
2015-08-11 21:01:07 +02:00
Allan Odgaard
457969788e
Use std::tuple for the OS version
...
This makes compatibility checks simpler, since we can use a single comparison operator.
2015-06-23 22:46:58 +02:00
Joachim Mårtensson
70893f4583
Use dense_hash_map for style cache
2015-05-09 21:24:38 +02:00
Allan Odgaard
0f4397769d
Include the cstdlib header
...
This is to ensure we get the integer prototype for std::abs
2015-05-06 21:19:07 +02:00
Ronald Wampler
4aff7098a5
Use std::abs instead of abs()
...
This suppresses a couple of warnings with the latest version of clang shipped with Xcode 6.3.
2015-04-30 15:15:56 +02:00
Allan Odgaard
29a576ffbe
Don’t go via helper for pthread_setname_np
...
This was previously done because the function wasn’t available until 10.7, but since that is (now) our deployment target, there is no need to wrap the call.
2014-12-25 09:36:01 +01:00
Allan Odgaard
0bdefafac3
Remove dependency graph support to only framework using this API
2014-12-25 09:33:56 +01:00
Allan Odgaard
aeb9ab7d00
Move server.h to the only framework left using this legacy API
2014-12-25 09:33:13 +01:00
Allan Odgaard
0c99cb0699
Remove unused helper function
2014-12-25 09:32:23 +01:00
Allan Odgaard
3a86535022
Move boost crc include to PCH
...
Also use unsigned integer for the checksum.
2014-10-18 12:36:23 +02:00
Allan Odgaard
7cb2330aae
Log error if curl_easy_init() or accept() fails
2014-09-30 14:15:11 +02:00
Allan Odgaard
ec81a045af
Force a layout before opening window (from tests)
...
This appears to be a requirement (to do it manually). Running 10.9.4.
2014-09-17 10:35:25 +02:00
Allan Odgaard
57e43f27e3
Return 0 if Gestalt() fails
2014-08-21 16:06:33 +02:00
Allan Odgaard
c272afaff2
Cleanup/harmonize whitespace
...
Leading indent should consist only of tabs, beyond that, only spaces should be used.
2014-04-25 16:55:31 +07:00
Allan Odgaard
39b94e6ac3
Harmonize whitespace and add trailing newline
2014-04-14 14:26:52 +07:00
Allan Odgaard
5b47dca1e6
Add ‘sysexits.h’ as a precompiled header
2014-04-14 08:55:06 +07:00
Allan Odgaard
10d94644f7
Switch oak::server_t implementation from pthread → libdispatch
...
This makes the abstraction redundant and it should be removed. I am doing that as a multi-step process, since the previous implementation was blocking tests from being updated to the new (dispatch queue based) test system.
2014-04-08 15:43:20 +07:00
Allan Odgaard
69c83e56df
The ‘const’ keyword should be to the right of its type
...
The standard doesn’t care which side the keyword is placed on, but placing it on the right makes it easier to read types.
E.g. reading “int const* const” from right to left we get “const pointer to const integer”.
2014-03-31 08:27:19 +07:00
Allan Odgaard
2c20ab23b0
Ask for maximum queue length for pending socket connections
...
This is mainly because the SOMAXCONN constant looks better (in the source) than some arbitrarily chosen number. The constant is presently defined as 128 so it doesn’t seem wasteful, and presumably the queue will only take up space if we are not actually responding to socket connections.
2014-03-23 22:47:16 +07:00
Allan Odgaard
c2397484b8
Use C++11 for loop
...
Majority of the edits done using the following ruby script:
def update_loops(src)
dst, cnt = '', 0
block_indent, variable = nil, nil
src.each_line do |line|
if block_indent
if line =~ /^#{block_indent}([{}\t])|^\t*$/
block_indent = nil if $1 == '}'
line = line.gsub(%r{ ([^a-z>]) \(\*#{variable}\) | \*#{variable}\b | \b#{variable}(->) }x) do
$1.to_s + variable + ($2 == "->" ? "." : "")
end
else
block_indent = nil
end
elsif line =~ /^(\t*)c?iterate\((\w+), (?!diacritics::make_range)(.*\))$/
block_indent, variable = $1, $2
line = "#$1for(auto const& #$2 : #$3\n"
cnt += 1
end
dst << line
end
return dst, cnt
end
paths.each do |path|
src = IO.read(path)
cnt = 1
while cnt != 0
src, cnt = update_loops(src)
STDERR << "#{path}: #{cnt}\n"
end
File.open(path, "w") { |io| io << src }
end
2014-03-03 10:34:13 +07:00
Allan Odgaard
1c308c810d
Use map::emplace instead of inserting std::pair (C++11)
2013-09-05 20:59:11 +02:00
Allan Odgaard
02e64d17e6
Remove unused operation queue type
2013-09-03 12:27:20 +02:00
Allan Odgaard
e4e80a946c
Use std::make_shared
2013-09-03 12:27:20 +02:00
Allan Odgaard
374f8a2248
Make oak::callbacks_t somewhat thread safe
...
If we only add, remove, and signal callbacks, the data type is now thread safe. This is mainly for the purpose of the concurrent tests.
2013-08-24 01:19:29 +02:00
Allan Odgaard
7a12fd1c41
Don’t define global macros that are only used in QuickLook target
2013-08-16 22:40:07 +02:00
Allan Odgaard
b25f716f86
Remove rforeach macro
2013-08-12 19:32:23 +02:00
Allan Odgaard
12067e806a
Don’t keep mutex locked when calling client code
...
The mutex was locked to ensure that the client object did not go away, but the client’s code may terminate the program which destroys the server_t instance and thereby the mutex itself, which would previously cause an assertion to trigger, since the mutex was locked during destruction.
In practice there is no issue with the mutex not being locked while accessing the client object, as “unregister_client” and “master_run” are both called from the main thread, except for tests, but here we do not unregister client objects before their requests have been handled.
2013-08-12 19:32:23 +02:00
Allan Odgaard
2ad42430c4
Make client API for oak::server_t thread safe
2013-08-05 11:17:04 +02:00
Allan Odgaard
c3a6294806
Use std::function instead of templated argument
2013-08-03 17:22:01 +02:00
Allan Odgaard
84ef9bb768
Use std::transform instead of custom code
2013-08-03 13:22:03 +02:00
Allan Odgaard
84dc2dd871
Allow a target to use both new and old test system
...
Presently the new test system cannot be used for (interactive) GUI tests, so we keep the old one until we have that feature in the new.
2013-08-01 19:01:24 +02:00
Jacob Bandes-Storch
17e822896e
Add Quick Look generator
...
Closes #1062
2013-07-30 23:11:49 +02:00
Allan Odgaard
ce395fa46a
Make bundle item queries thread safe
...
Note though that mutating the bundle item index is not allowed if other threads are querying it.
2013-07-26 13:53:57 +02:00
Allan Odgaard
d5d01542f7
Support copying test::jail_t
2013-07-25 13:54:25 +02:00
Allan Odgaard
eb1acfe70f
Remove box_layout.h header (unused)
2013-06-28 08:42:06 +02:00
Allan Odgaard
58cfa20a1b
Add operator<< for std::map
...
This is to allow chaining inserts and to avoid temporary variables when inserting maps returned from functions.
2013-05-12 11:09:16 +07:00