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

Build errors on Solaris 11 #11

Open
Tracked by #196
nemequ opened this issue Mar 15, 2016 · 0 comments
Open
Tracked by #196

Build errors on Solaris 11 #11

nemequ opened this issue Mar 15, 2016 · 0 comments

Comments

@nemequ
Copy link

nemequ commented Mar 15, 2016

In file included from /export/home/nemequ/squash/plugins/lzham/lzham/lzhamdecomp/lzham_core.h:303:0,
                 from /export/home/nemequ/squash/plugins/lzham/lzham/lzhamcomp/lzham_lzcomp_internal.cpp:3:
/export/home/nemequ/squash/plugins/lzham/lzham/lzhamdecomp/lzham_vector.h: In instantiation of 'bool lzham::vector<T>::insert(lzham::uint, const T*, lzham::uint) [with T = unsigned char; lzham::uint = unsigned int]':
/export/home/nemequ/squash/plugins/lzham/lzham/lzhamdecomp/lzham_vector.h:328:58:   required from 'bool lzham::vector<T>::append(const lzham::vector<T>&) [with T = unsigned char]'
/export/home/nemequ/squash/plugins/lzham/lzham/lzhamcomp/lzham_lzcomp_internal.cpp:522:56:   required from here
/export/home/nemequ/squash/plugins/lzham/lzham/lzhamdecomp/lzham_vector.h:289:77: error: 'memmove' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
                memmove(m_p + index + n, m_p + index, sizeof(T) * num_to_move);
                                                                             ^
In file included from /usr/include/string.h:11:0,
                 from /export/home/nemequ/squash/plugins/lzham/lzham/lzhamcomp/lzham_lzcomp_internal.cpp:8:
/usr/include/iso/string_iso.h:55:14: note: 'void* std::memmove(void*, const void*, std::size_t)' declared here, later in the translation unit
 extern void *memmove(void *, const void *, size_t);
              ^
*** Error code 1

This fixes it:

diff --git a/lzhamcomp/lzham_lzcomp_internal.cpp b/lzhamcomp/lzham_lzcomp_internal.cpp
index 6b38bfc..34c9c02 100644
--- a/lzhamcomp/lzham_lzcomp_internal.cpp
+++ b/lzhamcomp/lzham_lzcomp_internal.cpp
@@ -1,11 +1,11 @@
 // File: lzham_lzcomp_internal.cpp
 // See Copyright Notice and license at the end of include/lzham.h
+#include <string.h>
 #include "lzham_core.h"
 #include "lzham_lzcomp_internal.h"
 #include "lzham_checksum.h"
 #include "lzham_timer.h"
 #include "lzham_lzbase.h"
-#include <string.h>

 // Update and print high-level coding statistics if set to 1.
 // TODO: Add match distance coding statistics.

But then I get

/export/home/nemequ/squash/plugins/lzham/lzham/lzhamdecomp/lzham_mem.cpp: In function 'void* lzham::lzham_default_realloc(void*, std::size_t, std::size_t*, lzham_bool, void*)':
/export/home/nemequ/squash/plugins/lzham/lzham/lzhamdecomp/lzham_mem.cpp:81:49: error: 'malloc_usable_size' was not declared in this scope
             *pActual_size = p_new ? _msize(p_new) : 0;
                                                 ^
/export/home/nemequ/squash/plugins/lzham/lzham/lzhamdecomp/lzham_mem.cpp:117:49: error: 'malloc_usable_size' was not declared in this scope
             *pActual_size = _msize(p_final_block);
                                                 ^
/export/home/nemequ/squash/plugins/lzham/lzham/lzhamdecomp/lzham_mem.cpp: In function 'std::size_t lzham::lzham_default_msize(void*, void*)':
/export/home/nemequ/squash/plugins/lzham/lzham/lzhamdecomp/lzham_mem.cpp:126:26: error: 'malloc_usable_size' was not declared in this scope
       return p ? _msize(p) : 0;
                          ^
*** Error code 1

Which I'm not aware of an easy fix for… I'm no Solaris expert, but I can't find an equivalent for _msize/malloc_size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant