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

Bern #85

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Bern #85

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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ libsass-build/include/sass/version.h: libsass-src/include/sass/version.h.in
sed 's/@PACKAGE_VERSION@/$(LIBSASS_VERSION)/' libsass-src/include/sass/version.h.in > libsass-build/include/sass/version.h

.PHONY: libsass-build
SOURCES=libsass-build/*.cpp libsass-build/*.c libsass-build/*.h libsass-build/*.hpp
SOURCES = $(wildcard libsass-build/*.cpp) $(wildcard libsass-build/*/*.cpp) $(wildcard libsass-build/*.c) $(wildcard libsass-build/*/*.c) $(wildcard libsass-build/*.h) $(wildcard libsass-build/*/*.h) $(wildcard libsass-build/*.hpp) $(wildcard libsass-build/*/*.hpp)
libsass-build: libsass-src
mkdir -p libsass-build/include
rm -rf $(SOURCES)
Expand Down
37 changes: 28 additions & 9 deletions libs/unity.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
#ifndef USE_LIBSASS


#include "../libsass-build/ast.cpp"
#include "../libsass-build/ast2c.cpp"
#include "../libsass-build/ast_fwd_decl.cpp"
#include "../libsass-build/ast_sel_cmp.cpp"
#include "../libsass-build/ast_sel_super.cpp"
#include "../libsass-build/ast_sel_unify.cpp"
#include "../libsass-build/ast_sel_weave.cpp"
#include "../libsass-build/ast_selectors.cpp"
#include "../libsass-build/ast_supports.cpp"
#include "../libsass-build/ast_values.cpp"
#include "../libsass-build/backtrace.cpp"
#include "../libsass-build/base64vlq.cpp"
#include "../libsass-build/bind.cpp"
#include "../libsass-build/c2ast.cpp"
#include "../libsass-build/check_nesting.cpp"
#include "../libsass-build/color_maps.cpp"
#include "../libsass-build/constants.cpp"
Expand All @@ -15,35 +23,46 @@
#include "../libsass-build/environment.cpp"
#include "../libsass-build/error_handling.cpp"
#include "../libsass-build/eval.cpp"
#include "../libsass-build/eval_selectors.cpp"
#include "../libsass-build/expand.cpp"
#include "../libsass-build/extend.cpp"
#include "../libsass-build/extender.cpp"
#include "../libsass-build/extension.cpp"
#include "../libsass-build/file.cpp"
#include "../libsass-build/functions.cpp"
#include "../libsass-build/fn_colors.cpp"
#include "../libsass-build/fn_lists.cpp"
#include "../libsass-build/fn_maps.cpp"
#include "../libsass-build/fn_miscs.cpp"
#include "../libsass-build/fn_numbers.cpp"
#include "../libsass-build/fn_selectors.cpp"
#include "../libsass-build/fn_strings.cpp"
#include "../libsass-build/fn_utils.cpp"
#include "../libsass-build/inspect.cpp"
#include "../libsass-build/json.cpp"
#include "../libsass-build/lexer.cpp"
#include "../libsass-build/listize.cpp"
#include "../libsass-build/node.cpp"
#include "../libsass-build/memory/allocator.cpp"
#include "../libsass-build/memory/shared_ptr.cpp"
#include "../libsass-build/operators.cpp"
#include "../libsass-build/output.cpp"
#include "../libsass-build/parser.cpp"
#include "../libsass-build/parser_selectors.cpp"
#include "../libsass-build/plugins.cpp"
#include "../libsass-build/position.cpp"
#include "../libsass-build/prelexer.cpp"
#include "../libsass-build/remove_placeholders.cpp"
#include "../libsass-build/sass.cpp"
#include "../libsass-build/sass2scss.cpp"
#include "../libsass-build/sass_context.cpp"
#include "../libsass-build/sass.cpp"
#include "../libsass-build/sass_functions.cpp"
#include "../libsass-build/sass_util.cpp"
#include "../libsass-build/sass_values.cpp"
#include "../libsass-build/source.cpp"
#include "../libsass-build/source_map.cpp"
#include "../libsass-build/subset_map.cpp"
#include "../libsass-build/to_c.cpp"
#include "../libsass-build/stylesheet.cpp"
#include "../libsass-build/to_value.cpp"
#include "../libsass-build/units.cpp"
#include "../libsass-build/utf8_string.cpp"
#include "../libsass-build/util.cpp"
#include "../libsass-build/util_string.cpp"
#include "../libsass-build/values.cpp"
#include "../libsass-build/memory/SharedPtr.cpp"

#endif
91 changes: 91 additions & 0 deletions libsass-build/MurmurHash2.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
//-----------------------------------------------------------------------------
// MurmurHash2 was written by Austin Appleby, and is placed in the public
// domain. The author hereby disclaims copyright to this source code.
//-----------------------------------------------------------------------------
// LibSass only needs MurmurHash2, so we made this header only
//-----------------------------------------------------------------------------

#ifndef _MURMURHASH2_H_
#define _MURMURHASH2_H_

//-----------------------------------------------------------------------------
// Platform-specific functions and macros

// Microsoft Visual Studio

#if defined(_MSC_VER) && (_MSC_VER < 1600)

typedef unsigned char uint8_t;
typedef unsigned int uint32_t;
typedef unsigned __int64 uint64_t;

// Other compilers

#else // defined(_MSC_VER)

#include <stdint.h>

#endif // !defined(_MSC_VER)

//-----------------------------------------------------------------------------

inline uint32_t MurmurHash2 ( const void * key, int len, uint32_t seed )
{
// 'm' and 'r' are mixing constants generated offline.
// They're not really 'magic', they just happen to work well.

const uint32_t m = 0x5bd1e995;
const int r = 24;

// Initialize the hash to a 'random' value

uint32_t h = seed ^ len;

// Mix 4 bytes at a time into the hash

const unsigned char * data = (const unsigned char *)key;

while(len >= 4)
{
uint32_t k = *(uint32_t*)data;

k *= m;
k ^= k >> r;
k *= m;

h *= m;
h ^= k;

data += 4;
len -= 4;
}

// Handle the last few bytes of the input array

switch(len)
{
case 3:
h ^= data[2] << 16;
/* fall through */
case 2:
h ^= data[1] << 8;
/* fall through */
case 1:
h ^= data[0];
h *= m;
};

// Do a few final mixes of the hash to ensure the last few
// bytes are well-incorporated.

h ^= h >> 13;
h *= m;
h ^= h >> 15;

return h;
}

//-----------------------------------------------------------------------------

#endif // _MURMURHASH2_H_

Loading