forked from futurepress/react-native-static-server
-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
1,476 additions
and
352 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
cmake_minimum_required(VERSION 3.5 FATAL_ERROR) | ||
project(GLOB C) | ||
|
||
set(CMAKE_C_STANDARD 99) | ||
set(CMAKE_C_STANDARD_REQUIRED TRUE) | ||
|
||
set(HEADERS collate.h freebsd-compat.h glob.h) | ||
set(SOURCES glob.c) | ||
|
||
add_compile_definitions(__USE_BSD) | ||
add_library(glob ${HEADERS} ${SOURCES}) | ||
|
||
install(TARGETS glob) | ||
install(FILES ${HEADERS} DESTINATION include) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
The Glob library is a part of Android SDK starting from SDK 28; thus, to support | ||
older SDKs we compile it from sources. These source files are taken from | ||
the https://android.googlesource.com/platform/bionic repository | ||
([bionic](https://en.wikipedia.org/wiki/Bionic_%28software%29) | ||
is Android's C library, math library, and dynamic linker). |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "freebsd-compat.h" | ||
|
||
/** | ||
* [reallocarray(3)](https://man7.org/linux/man-pages/man3/realloc.3.html) resizes | ||
* allocated memory on the heap. | ||
* | ||
* Equivalent to `realloc(__ptr, __item_count * __item_size)` but fails if the | ||
* multiplication overflows. | ||
* | ||
* Returns a pointer (which may be different from `__ptr`) to the resized | ||
* memory on success and returns a null pointer and sets `errno` on failure | ||
* (but see the notes for malloc()). | ||
*/ | ||
#if __ANDROID_API__ >= 29 | ||
void* _Nullable reallocarray(void* _Nullable __ptr, size_t __item_count, size_t __item_size) __BIONIC_ALLOC_SIZE(2, 3) __INTRODUCED_IN(29); | ||
#else | ||
#include <errno.h> | ||
static __inline void* _Nullable reallocarray(void* _Nullable __ptr, size_t __item_count, size_t __item_size) { | ||
size_t __new_size; | ||
if (__builtin_mul_overflow(__item_count, __item_size, &__new_size)) { | ||
errno = ENOMEM; | ||
return NULL; | ||
} | ||
return realloc(__ptr, __new_size); | ||
} | ||
#endif |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (C) 2013 The Android Open Source Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#define _BSD_SOURCE | ||
|
||
#define REPLACE_GETOPT | ||
|
||
/* FreeBSD has this, but we can't really implement it correctly on Linux. */ | ||
#define issetugid() 0 | ||
|
||
#define __compiler_membar() __asm __volatile(" " : : : "memory") |
Oops, something went wrong.