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

A few minor portability fixes #3

Merged
merged 2 commits into from
Sep 30, 2015
Merged

A few minor portability fixes #3

merged 2 commits into from
Sep 30, 2015

Conversation

jbeich
Copy link

@jbeich jbeich commented Sep 22, 2015

Tested on FreeBSD 9.3-11.0 i386/amd64.

On BSDs including malloc.h causes a warning/error while on GNU systems
it provides malloc(3) extensions but not of _mm-type which are specific
to compiler.

  /usr/include/malloc.h:3:2: error: "<malloc.h> has been replaced by <stdlib.h>"
  #error "<malloc.h> has been replaced by <stdlib.h>"
   ^

i386 without -march or -msse can hit another issue:

  src/Buffer.hpp:147:13: error: use of undeclared identifier '_mm_free'
              _mm_free(host_ptr);
              ^
  src/Buffer.hpp:282:24: error: use of undeclared identifier '_mm_malloc'
              host_ptr = _mm_malloc(byte_size, 64);
                         ^
  src/Buffer.hpp:314:24: error: use of undeclared identifier '_mm_malloc'
              host_ptr = _mm_malloc(byte_size, 64);
                         ^
  src/Buffer.hpp:325:24: error: use of undeclared identifier '_mm_malloc'
              host_ptr = _mm_malloc(byte_size, 64);
                         ^
  4 errors generated.
ThreadPool is only implemented on Windows and Linux. Trying to build on
a BSD descendant ends up with:

  In file included from src/Buffer.hpp:14:
  src/threadPool.hpp:26:19: error: unknown type name
        'event_t'
  void notify_event(event_t ev);
                    ^
  src/threadPool.hpp:27:1: error: unknown type name 'event_t'
  event_t create_event(void);
  ^
  src/threadPool.hpp:28:19: error: unknown type name
        'event_t'
  void delete_event(event_t ev);
                    ^
  src/threadPool.hpp:29:19: error: unknown type name
        'event_t'
  void notify_event(event_t ev);
                    ^
  src/threadPool.hpp:66:2: error: unknown type name 'event_t'
          event_t to_client;
          ^
  src/threadPool.hpp:92:2: error: unknown type name 'event_t'
          event_t to_master;
          ^
  6 errors generated.
@ctrlcctrlv ctrlcctrlv mentioned this pull request Sep 23, 2015
tanakamura added a commit that referenced this pull request Sep 30, 2015
A few minor portability fixes
@tanakamura tanakamura merged commit 50c3489 into tanakamura:master Sep 30, 2015
@jbeich jbeich deleted the freebsd branch October 2, 2015 20:40
@jbeich
Copy link
Author

jbeich commented Oct 7, 2015

+1 tested build via DPorts automation

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

Successfully merging this pull request may close these issues.

None yet

2 participants