Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Darwin's libicucore.A.dylib. #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ext/charlock_holmes/darwin/unicode/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
COPYRIGHT AND PERMISSION NOTICE
Copyright (c) 1995-2013 International Business Machines Corporation and others
All rights reserved.
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, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation.
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 OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.
57 changes: 57 additions & 0 deletions ext/charlock_holmes/darwin/unicode/bytestream.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#ifndef __BYTESTREAM_H__
#define __BYTESTREAM_H__
#include "unicode/utypes.h"
#include "unicode/uobject.h"
#include "unicode/std_string.h"
U_NAMESPACE_BEGIN
class U_COMMON_API ByteSink : public UMemory {
public:
ByteSink() { }
virtual ~ByteSink() { }
virtual void Append(const char* bytes, int32_t n) = 0;
virtual char* GetAppendBuffer(int32_t min_capacity,
int32_t desired_capacity_hint,
char* scratch, int32_t scratch_capacity,
int32_t* result_capacity);
virtual void Flush();
private:
ByteSink(const ByteSink &);
ByteSink &operator=(const ByteSink &);
};
class U_COMMON_API CheckedArrayByteSink : public ByteSink {
public:
CheckedArrayByteSink(char* outbuf, int32_t capacity);
virtual CheckedArrayByteSink& Reset();
virtual void Append(const char* bytes, int32_t n);
virtual char* GetAppendBuffer(int32_t min_capacity,
int32_t desired_capacity_hint,
char* scratch, int32_t scratch_capacity,
int32_t* result_capacity);
int32_t NumberOfBytesWritten() const { return size_; }
UBool Overflowed() const { return overflowed_; }
int32_t NumberOfBytesAppended() const { return appended_; }
private:
char* outbuf_;
const int32_t capacity_;
int32_t size_;
int32_t appended_;
UBool overflowed_;
CheckedArrayByteSink();
CheckedArrayByteSink(const CheckedArrayByteSink &);
CheckedArrayByteSink &operator=(const CheckedArrayByteSink &);
};
#if U_HAVE_STD_STRING
template<typename StringClass>
class StringByteSink : public ByteSink {
public:
StringByteSink(StringClass* dest) : dest_(dest) { }
virtual void Append(const char* data, int32_t n) { dest_->append(data, n); }
private:
StringClass* dest_;
StringByteSink();
StringByteSink(const StringByteSink &);
StringByteSink &operator=(const StringByteSink &);
};
#endif
U_NAMESPACE_END
#endif
76 changes: 76 additions & 0 deletions ext/charlock_holmes/darwin/unicode/localpointer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#ifndef __LOCALPOINTER_H__
#define __LOCALPOINTER_H__
#include "unicode/utypes.h"
#if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN
template<typename T>
class LocalPointerBase {
public:
explicit LocalPointerBase(T *p=NULL) : ptr(p) {}
~LocalPointerBase() { }
UBool isNull() const { return ptr==NULL; }
UBool isValid() const { return ptr!=NULL; }
bool operator==(const T *other) const { return ptr==other; }
bool operator!=(const T *other) const { return ptr!=other; }
T *getAlias() const { return ptr; }
T &operator*() const { return *ptr; }
T *operator->() const { return ptr; }
T *orphan() {
T *p=ptr;
ptr=NULL;
return p;
}
void adoptInstead(T *p) {
ptr=p;
}
protected:
T *ptr;
private:
bool operator==(const LocalPointerBase &other);
bool operator!=(const LocalPointerBase &other);
LocalPointerBase(const LocalPointerBase &other);
void operator=(const LocalPointerBase &other);
static void * U_EXPORT2 operator new(size_t size);
static void * U_EXPORT2 operator new[](size_t size);
#if U_HAVE_PLACEMENT_NEW
static void * U_EXPORT2 operator new(size_t, void *ptr);
#endif
};
template<typename T>
class LocalPointer : public LocalPointerBase<T> {
public:
explicit LocalPointer(T *p=NULL) : LocalPointerBase<T>(p) {}
~LocalPointer() {
delete LocalPointerBase<T>::ptr;
}
void adoptInstead(T *p) {
delete LocalPointerBase<T>::ptr;
LocalPointerBase<T>::ptr=p;
}
};
template<typename T>
class LocalArray : public LocalPointerBase<T> {
public:
explicit LocalArray(T *p=NULL) : LocalPointerBase<T>(p) {}
~LocalArray() {
delete[] LocalPointerBase<T>::ptr;
}
void adoptInstead(T *p) {
delete[] LocalPointerBase<T>::ptr;
LocalPointerBase<T>::ptr=p;
}
T &operator[](ptrdiff_t i) const { return LocalPointerBase<T>::ptr[i]; }
};
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction) \
class LocalPointerClassName : public LocalPointerBase<Type> { \
public: \
explicit LocalPointerClassName(Type *p=NULL) : LocalPointerBase<Type>(p) {} \
~LocalPointerClassName() { closeFunction(ptr); } \
void adoptInstead(Type *p) { \
closeFunction(ptr); \
ptr=p; \
} \
}
U_NAMESPACE_END
#endif
#endif
11 changes: 11 additions & 0 deletions ext/charlock_holmes/darwin/unicode/parseerr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef PARSEERR_H
#define PARSEERR_H
#include "unicode/utypes.h"
enum { U_PARSE_CONTEXT_LEN = 16 };
typedef struct UParseError {
int32_t line;
int32_t offset;
UChar preContext[U_PARSE_CONTEXT_LEN];
UChar postContext[U_PARSE_CONTEXT_LEN];
} UParseError;
#endif
175 changes: 175 additions & 0 deletions ext/charlock_holmes/darwin/unicode/platform.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
#ifndef _PLATFORM_H
#define _PLATFORM_H
#if defined(UVERNUM_H)
# error Do not include unicode/uvernum.h before #including unicode/platform.h. Instead of unicode/uvernum.h, #include unicode/uversion.h
#endif
#ifndef UCLN_NO_AUTO_CLEANUP
#define UCLN_NO_AUTO_CLEANUP 1
#endif
#ifndef CYGWINMSVC
#ifndef U_DARWIN
#define U_DARWIN
#endif
#ifndef U_HAVE_DIRENT_H
#define U_HAVE_DIRENT_H 1
#endif
#ifndef U_HAVE_INTTYPES_H
#define U_HAVE_INTTYPES_H 1
#endif
#ifndef U_IOSTREAM_SOURCE
#define U_IOSTREAM_SOURCE 199711
#endif
#ifndef U_HAVE_STD_STRING
#define U_HAVE_STD_STRING 1
#endif
#ifndef U_HAVE_INT8_T
#define U_HAVE_INT8_T 1
#endif
#ifndef U_HAVE_UINT8_T
#define U_HAVE_UINT8_T 1
#endif
#ifndef U_HAVE_INT16_T
#define U_HAVE_INT16_T 1
#endif
#ifndef U_HAVE_UINT16_T
#define U_HAVE_UINT16_T 1
#endif
#ifndef U_HAVE_INT32_T
#define U_HAVE_INT32_T 1
#endif
#ifndef U_HAVE_UINT32_T
#define U_HAVE_UINT32_T 1
#endif
#ifndef U_HAVE_INT64_T
#define U_HAVE_INT64_T 1
#endif
#ifndef U_HAVE_UINT64_T
#define U_HAVE_UINT64_T 1
#endif
#ifndef U_HAVE_NAMESPACE
#define U_HAVE_NAMESPACE 1
#endif
#if defined(BYTE_ORDER) && defined(BIG_ENDIAN)
#define U_IS_BIG_ENDIAN (BYTE_ORDER == BIG_ENDIAN)
#else
#define U_IS_BIG_ENDIAN 0
#endif
#ifndef ICU_USE_THREADS
#define ICU_USE_THREADS 1
#endif
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
#define UMTX_STRONG_MEMORY_MODEL 1
#endif
#ifndef U_DEBUG
#define U_DEBUG 0
#endif
#ifndef U_RELEASE
#define U_RELEASE 1
#endif
#ifndef U_DISABLE_RENAMING
#define U_DISABLE_RENAMING 1
#endif
#ifndef U_OVERRIDE_CXX_ALLOCATION
#define U_OVERRIDE_CXX_ALLOCATION 1
#endif
#ifndef U_HAVE_PLACEMENT_NEW
#define U_HAVE_PLACEMENT_NEW 1
#endif
#ifndef U_ENABLE_TRACING
#define U_ENABLE_TRACING 0
#endif
#ifndef U_ENABLE_DYLOAD
#define U_ENABLE_DYLOAD 1
#endif
#ifndef U_CHECK_DYLOAD
#define U_CHECK_DYLOAD 1
#endif
#ifndef U_DEFAULT_SHOW_DRAFT
#define U_DEFAULT_SHOW_DRAFT 1
#endif
#if ((defined(OS390) && (!defined(__CHARSET_LIB) || !__CHARSET_LIB))) || defined(OS400)
# define U_CHARSET_FAMILY 1
#endif
#ifndef U_HAVE_WCHAR_H
#define U_HAVE_WCHAR_H 1
#endif
#ifndef U_SIZEOF_WCHAR_T
#define U_SIZEOF_WCHAR_T 4
#endif
#ifndef U_HAVE_WCSCPY
#define U_HAVE_WCSCPY 1
#endif
#ifndef U_GNUC_UTF16_STRING
#define U_GNUC_UTF16_STRING 0
#endif
#if 1 || defined(U_CHECK_UTF16_STRING)
#if (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
|| (defined(__HP_aCC) && __HP_aCC >= 035000) \
|| (defined(__HP_cc) && __HP_cc >= 111106) \
|| U_GNUC_UTF16_STRING
#define U_DECLARE_UTF16(string) u ## string
#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550)
#define U_DECLARE_UTF16(string) U ## string
#elif U_SIZEOF_WCHAR_T == 2 \
&& (U_CHARSET_FAMILY == 0 || ((defined(OS390) || defined(OS400)) && defined(__UCS2__)))
#define U_DECLARE_UTF16(string) L ## string
#endif
#endif
#ifndef U_HAVE_NL_LANGINFO_CODESET
#define U_HAVE_NL_LANGINFO_CODESET 1
#endif
#ifndef U_NL_LANGINFO_CODESET
#define U_NL_LANGINFO_CODESET CODESET
#endif
#if 1
#define U_TZSET tzset
#endif
#if 1
#define U_TIMEZONE timezone
#endif
#if 1
#define U_TZNAME tzname
#endif
#define U_HAVE_MMAP 1
#define U_HAVE_POPEN 1
#if 1
#define U_EXPORT __attribute__((visibility("default")))
#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
|| (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550)
#define U_EXPORT __global
#else
#define U_EXPORT
#endif
#define U_EXPORT2
#if defined(U_CYGWIN) && !defined(__GNUC__)
#define U_IMPORT __declspec(dllimport)
#else
#define U_IMPORT
#endif
#ifndef U_INLINE
# ifdef __cplusplus
# define U_INLINE inline
# else
# define U_INLINE __inline__
# endif
#endif
#ifndef U_ALIGN_CODE
#define U_ALIGN_CODE(n)
#endif
#ifndef U_HAVE_GCC_ATOMICS
#define U_HAVE_GCC_ATOMICS 1
#endif
#ifndef U_MAKE
#define U_MAKE "/usr/bin/gnumake"
#endif
#endif
# define U_LIB_SUFFIX_C_NAME
# define U_LIB_SUFFIX_C_NAME_STRING ""
# define U_HAVE_LIB_SUFFIX 0
#if U_HAVE_LIB_SUFFIX
# ifndef U_ICU_ENTRY_POINT_RENAME
# define U_ICU_ENTRY_POINT_RENAME(x) x ## _ ## 46 ##
# define U_DEF_ICUDATA_ENTRY_POINT(major, minor) icudt####major##minor##_dat
# endif
#endif
#endif
43 changes: 43 additions & 0 deletions ext/charlock_holmes/darwin/unicode/ptypes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#ifndef _PTYPES_H
#define _PTYPES_H
#include <sys/types.h>
#include "unicode/platform.h"
#if U_HAVE_INTTYPES_H
#ifdef OS390
#include <features.h>
#if ! U_HAVE_INT8_T
typedef signed char int8_t;
#endif
#if !defined(__uint8_t)
#define __uint8_t 1
typedef unsigned char uint8_t;
#endif
#endif
#include <inttypes.h>
#else
#if ! U_HAVE_INT8_T
typedef signed char int8_t;
#endif
#if ! U_HAVE_UINT8_T
typedef unsigned char uint8_t;
#endif
#if ! U_HAVE_INT16_T
typedef signed short int16_t;
#endif
#if ! U_HAVE_UINT16_T
typedef unsigned short uint16_t;
#endif
#if ! U_HAVE_INT32_T
typedef signed int int32_t;
#endif
#if ! U_HAVE_UINT32_T
typedef unsigned int uint32_t;
#endif
#if ! U_HAVE_INT64_T
typedef signed long long int64_t;
#endif
#if ! U_HAVE_UINT64_T
typedef unsigned long long uint64_t;
#endif
#endif
#endif
Loading