You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.2 KiB

  1. /* Copyright 2021 Nick Brassel, QMK
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include <sys/stat.h>
  17. #include <sys/types.h>
  18. #pragma GCC diagnostic ignored "-Wmissing-prototypes"
  19. __attribute__((weak, used)) int _read_r(struct _reent *r, int file, char *ptr, int len) {
  20. (void)r;
  21. (void)file;
  22. (void)ptr;
  23. (void)len;
  24. return -1;
  25. }
  26. __attribute__((weak, used)) int _lseek_r(struct _reent *r, int file, int ptr, int dir) {
  27. (void)r;
  28. (void)file;
  29. (void)ptr;
  30. (void)dir;
  31. return 0;
  32. }
  33. __attribute__((weak, used)) int _write_r(struct _reent *r, int file, char *ptr, int len) {
  34. (void)r;
  35. (void)file;
  36. (void)ptr;
  37. return len;
  38. }
  39. __attribute__((weak, used)) int _close_r(struct _reent *r, int file) {
  40. (void)r;
  41. (void)file;
  42. return 0;
  43. }
  44. __attribute__((weak, used)) caddr_t _sbrk_r(struct _reent *r, int incr) {
  45. (void)r;
  46. (void)incr;
  47. return (caddr_t)-1;
  48. }
  49. __attribute__((weak, used)) int _fstat_r(struct _reent *r, int file, struct stat *st) {
  50. (void)r;
  51. (void)file;
  52. (void)st;
  53. return 0;
  54. }
  55. __attribute__((weak, used)) int _isatty_r(struct _reent *r, int fd) {
  56. (void)r;
  57. (void)fd;
  58. return 1;
  59. }
  60. __attribute__((weak, used)) void _fini(void) { return; }
  61. __attribute__((weak, used)) pid_t _getpid(void) { return 1; }
  62. __attribute__((weak, noreturn)) void _exit(int i) {
  63. (void)i;
  64. while (1)
  65. ;
  66. }
  67. __attribute__((weak)) void _kill(void) {}
  68. __attribute__((weak)) void *__dso_handle;
  69. void __cxa_pure_virtual(void);
  70. __attribute__((weak)) void __cxa_pure_virtual() {
  71. while (1)
  72. ;
  73. }
  74. #pragma GCC diagnostic pop