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

colormap static load #2

Closed
aflux opened this issue Oct 11, 2013 · 4 comments
Closed

colormap static load #2

aflux opened this issue Oct 11, 2013 · 4 comments
Assignees

Comments

@aflux
Copy link
Owner

aflux commented Oct 11, 2013

static colormaps should be staticly written as

unsigned char * p = "\x01\x02\x03\x04...";

instead of

p[0] = 0x01; p[1] = 0x02; p[2] = 0x03; ...

@iltommi
Copy link
Collaborator

iltommi commented Oct 16, 2013

This is only possible in c++0x (which is still unavaible in the basic g++ os osx)

this doesn't compile on osx (you need a decent compiler)

#include
unsigned char * allocateandfill (int n) {
unsigned char *p=new unsigned char[n] {'\x01','\x02'};
return p;
}

int main () {
int n=100;
unsigned char *p=allocateandfill(n);
for (int i=0;i<n;i++) {
std::cerr << i << "\t" << (int)p[i] << std::endl;
}
}

@iltommi iltommi closed this as completed Oct 16, 2013
@ghost ghost assigned iltommi Oct 16, 2013
@iltommi
Copy link
Collaborator

iltommi commented Oct 16, 2013

ok it seems to be possible using macports, but you have to do this:
sudo port select --list gcc
sudo port select --set gcc mp-gcc48

and -std=c++11 flag should be turned on

@iltommi iltommi reopened this Oct 16, 2013
@iltommi
Copy link
Collaborator

iltommi commented Oct 16, 2013

In fact qmake wants to build with system gcc...
so you need to hack the neutrino.pri to force new compiler and this break the compilation (probably because QT is built upon gcc4.2)

and add these to neutrino.pri to tackle the default qmake definitions

QMAKE_CC = gcc
QMAKE_CXX = g++
QMAKE_LINK = $$QMAKE_CXX
QMAKE_LINK_SHLIB = $$QMAKE_CXX

worth the candle?

@iltommi
Copy link
Collaborator

iltommi commented Oct 17, 2013

done with memcpy

@iltommi iltommi closed this as completed Oct 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants