Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Fix mempcpy undefined error under macOs #150

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

Fix mempcpy undefined error under macOs #150

wants to merge 3 commits into from

Conversation

haoch
Copy link

@haoch haoch commented Jan 3, 2020

[ 25%] Linking C executable example_https_server
Undefined symbols for architecture x86_64:
  "_mempcpy", referenced from:
      _htp__evbuffer_add_iovec_ in libevhtp.a(evhtp.c.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@aflin
Copy link

aflin commented Jun 11, 2020

Thanks for finding this.
Unless you are ignoring the return value of mempcpy, it is not equivalent to memcpy. See the linux man page. In evhtp.c, it appears the return value of mempcpy is being used in a loop to append a buffer. Perhaps instead something like this (untested)?

#ifndef mempcpy
#define mempcpy(d,s,n)  memcpy((d),(s),(n)) + (n) 
#endif

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Successfully merging this pull request may close these issues.

3 participants