2121#define max_log 256
2222
2323
24- __attribute__((weak )) struct _IO_FILE * stderr = -1 ;
24+ __attribute__((weak )) struct _IO_FILE * stderr = ( _IO_FILE * ) -1 ;
2525
2626static int vwrite_err (const char * format , va_list ap )
2727{
@@ -55,7 +55,7 @@ __attribute__((weak)) int fprintf (FILE *__restrict __stream,
5555 return -1 ;
5656 } else {
5757 va_list args ;
58- int ret = 0 ;
58+ ret = 0 ;
5959 va_start (args , __format );
6060 ret += vwrite_err (__format , args );
6161 va_end (args );
@@ -102,7 +102,7 @@ extern uint64_t TEXT_BASE;
102102extern uint64_t TEXT_SIZE ;
103103extern uint64_t EH_FRM_HDR_BASE ;
104104extern uint64_t EH_FRM_HDR_SIZE ;
105- extern void IMAGE_BASE ;
105+ extern char IMAGE_BASE ;
106106
107107typedef Elf64_Phdr Elf_Phdr ;
108108int
@@ -121,7 +121,7 @@ dl_iterate_phdr (int (*callback) (struct dl_phdr_info *,
121121
122122 memset (pinfo , 0 , sizeof (* pinfo ));
123123
124- pinfo -> dlpi_addr = & IMAGE_BASE ;
124+ pinfo -> dlpi_addr = ( ElfW ( Addr )) & IMAGE_BASE ;
125125 pinfo -> dlpi_phnum = 2 ;
126126
127127 pinfo -> dlpi_phdr = phdr ;
@@ -154,7 +154,7 @@ void *libuw_malloc(size_t size)
154154{
155155 struct libwu_rs_alloc_meta * meta ;
156156 size_t alloc_size = size + sizeof (struct libwu_rs_alloc_meta );
157- meta = (void * )__rust_alloc (alloc_size , sizeof (size_t ));
157+ meta = (void * )__rust_c_alloc (alloc_size , sizeof (size_t ));
158158 if (!meta ) {
159159 return NULL ;
160160 }
@@ -169,5 +169,5 @@ void libuw_free(void *p)
169169 return ;
170170 }
171171 meta = META_FROM_PTR (p );
172- __rust_dealloc ((unsigned char * )meta , meta -> alloc_size , sizeof (size_t ));
172+ __rust_c_dealloc ((unsigned char * )meta , meta -> alloc_size , sizeof (size_t ));
173173}
0 commit comments