Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
libmbcommon: Add dummy atexit() until android/ndk#132 is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiao-Long Chen committed Aug 28, 2016
1 parent 59ab559 commit c4f9949
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cryptfstool/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,3 +371,5 @@ int main(int argc, char *argv[])

return ret ? EXIT_SUCCESS : EXIT_FAILURE;
}

#include "mbcommon/atexit_hack.c"
36 changes: 36 additions & 0 deletions libmbcommon/include/mbcommon/atexit_hack.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (C) 2016 Andrew Gunnerson <andrewgunnerson@gmail.com>
*
* This file is part of MultiBootPatcher
*
* MultiBootPatcher is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MultiBootPatcher is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MultiBootPatcher. If not, see <http://www.gnu.org/licenses/>.
*/

#ifdef __cplusplus
extern "C" {
#endif

// HACK: Remove when https://github.com/android-ndk/ndk/issues/132 is released
#ifdef __ARM_ARCH_7A__
int atexit(void (*function)(void))
{
// We don't use atexit() anyway
(void) function;
return 0;
}
#endif

#ifdef __cplusplus
}
#endif
2 changes: 2 additions & 0 deletions mbbootui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,3 +725,5 @@ void __android_log_assert(const char *cond, const char *tag,
}

}

#include "mbcommon/atexit_hack.c"
2 changes: 2 additions & 0 deletions mbtool/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,5 @@ int main(int argc, char *argv[])

return ret;
}

#include "mbcommon/atexit_hack.c"
4 changes: 3 additions & 1 deletion odinupdater/fuse-sparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,4 +359,6 @@ int main(int argc, char *argv[])
free(arg_ctx.target_file);

return fuse_ret;
}
}

#include "mbcommon/atexit_hack.c"
2 changes: 2 additions & 0 deletions odinupdater/odinupdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -909,3 +909,5 @@ int main(int argc, char *argv[])

return flash_zip() ? EXIT_SUCCESS : EXIT_FAILURE;
}

#include "mbcommon/atexit_hack.c"

0 comments on commit c4f9949

Please sign in to comment.