Sorry for delay , i completly miss this post.
Now i remember having this pb with memory.h when i builded some others emulators for android
.
the pb is a “naming clashing” because ndk include in stdlib.h memory.h ( which is BTW a blank header )
so the pb arrive when somewhere in emu they include stdlib.h and include path found the bad memory.h ( in your case the mame one)
in the past ,for other emulator to fix android build i had change all the memory.h to core_memory.h ( and fix all the include in file) .
but after having many time this pb , i choose to make a android standalone toolchain and simply comment #include <memory.h>
in the stdlib.h header (since it was a blank header).
Yes i know , it was a bad shortcut (which save me lot’s of time) , and for the time i completly forgot it.
/*
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _STDLIB_H_
#define _STDLIB_H_
#include <sys/cdefs.h>
/* wchar_t is required in stdlib.h according to POSIX.
* note that defining __need_wchar_t prevents stddef.h
* to define all other symbols it does normally */
#define __need_wchar_t
#include <stddef.h>
#include <stddef.h>
#include <string.h>
#include <alloca.h>
#include <strings.h>
//#include <memory.h>