⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uclib.h

📁 君正早期ucos系统(只有早期的才不没有打包成库),MPLAYER,文件系统,图片解码,浏览,电子书,录音,想学ucos,识货的人就下吧 russblock fmradio explore set
💻 H
字号:
#ifndef __UCLIB_H__
#define __UCLIB_H__

extern "C"
{
	
	unsigned int alloc(unsigned int nbytes);
	unsigned int Drv_realloc(unsigned int address,unsigned int nbytes);
	void deAlloc(unsigned int address);
  unsigned int Drv_calloc(unsigned int size,unsigned int n);
}

typedef struct
{
  int quot;			/* Quotient.  */
  int rem;			/* Remainder.  */
} div_t;


/*  */
#define div(a, b)                       \
({                                      \
  div_t result;                         \
  result.quot = a / b;                  \
  result.rem = a - (result.quot * b);   \
  result;                               \
})


#define abs(a)	   (((a) < 0) ? -(a) : (a))
/*
#define malloc(x) (void *)alloc(x)

#define free(x)    deAlloc((unsigned int)x)

#define calloc(x,n) (void *)Drv_calloc(x,n) 

#define realloc(x,size)  ((void *)Drv_realloc((unsigned int)x,(unsigned int)size))
*/
#define LocalAlloc(x,size) (void *)alloc(size)
#define LocalFree(x) deAlloc(()unsigned int)x)

#ifdef __cplusplus
/*
	void * operator new(unsigned int size)
	{
		 //printf("image new...\n");
			void *p = malloc(size);
			return (p);
	}
	void operator delete(void *p)
	{
		free(p);
	}
	
	void *operator new[](unsigned int size)
	{
		//printf("image new[]...\n");
		void *p = malloc(size);
		return (p);
	}
	void operator delete[](void *p) 
	{
		free(p);
	}
*/
#endif

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -