当前位置: 首页>>代码示例>>C++>>正文


C++ os_error函数代码示例

本文整理汇总了C++中os_error函数的典型用法代码示例。如果您正苦于以下问题:C++ os_error函数的具体用法?C++ os_error怎么用?C++ os_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了os_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: vmem_unmapfile

void vmem_unmapfile()
{
    dbg_printf("vmem_unmapfile()\n");

    vmem_decommit(preserve,preserve_size);
    vmem_release(preserve,preserve_size);
    preserve = NULL;
    preserve_size = 0;

#if 0
    if (pview)
    {   int i;

        i = UnmapViewOfFile(pview);
        dbg_printf("i = x%x\n",i);
        if (i == FALSE)
            os_error();
    }
#else
    // Note that under Windows 95, UnmapViewOfFile() seems to return random
    // values, not TRUE or FALSE.
    if (pview && UnmapViewOfFile(pview) == FALSE)
        os_error();
#endif
    pview = NULL;

    if (hFileMap != NULL && CloseHandle(hFileMap) != TRUE)
        os_error();
    hFileMap = NULL;

    if (hFile != INVALID_HANDLE_VALUE && CloseHandle(hFile) != TRUE)
        os_error();
    hFile = INVALID_HANDLE_VALUE;
}
开发者ID:DinrusGroup,项目名称:DRC,代码行数:34,代码来源:os.c

示例2: vmem_setfilesize

void vmem_setfilesize(unsigned long size)
{
    if (hFile != INVALID_HANDLE_VALUE)
    {   if (SetFilePointer(hFile,size,NULL,FILE_BEGIN) == 0xFFFFFFFF)
            os_error();
        if (SetEndOfFile(hFile) == FALSE)
            os_error();
    }
}
开发者ID:DinrusGroup,项目名称:DRC,代码行数:9,代码来源:os.c

示例3: rt_stk_check

__weak void rt_stk_check (void) {
  /* Check for stack overflow. */
  if ((os_tsk.run->tsk_stack < (U32)os_tsk.run->stack) || 
      (os_tsk.run->stack[0] != MAGIC_WORD)) {
    os_error (OS_ERR_STK_OVF);
  }
}
开发者ID:GuentherMartin,项目名称:CMSIS_5,代码行数:7,代码来源:rt_System.c

示例4: os_heapterm

void os_heapterm()
{
    if (hHeap)
    {   if (HeapDestroy(hHeap) == FALSE)
            os_error();
    }
}
开发者ID:DinrusGroup,项目名称:DRC,代码行数:7,代码来源:os.c

示例5: os_mbx_psh

void os_mbx_psh (P_MCB p_CB, void *p_msg) {
  /* Store the message to the mailbox queue or pass it to task directly. */
  P_TCB p_TCB;

  /* Check if this was an 'isr_mbx_receive ()' post service request.   */
  if (p_CB->p_lnk != NULL && p_CB->isr_st == 2) {
    /* A task is waiting to send message, remove it from the waiting list. */
    p_CB->isr_st = 0;
    p_TCB = os_get_first ((P_XCB)p_CB);
    p_TCB->ret_val = OS_R_OK;
    goto rdy;
  }
  /* A task is waiting for message, pass the message to task directly. */
  if (p_CB->p_lnk != NULL && p_CB->count == 0) {
    p_TCB = os_get_first ((P_XCB)p_CB);
    p_TCB->p_msg = p_msg;
    p_TCB->ret_val = OS_R_MBX;
rdy:p_TCB->state = READY;
    os_rmv_dly (p_TCB);
    os_put_prio (&os_rdy, p_TCB);
  }
  else {
    /* No task is waiting for message, store it to the mailbox queue. */
    if (p_CB->count < p_CB->size) {
      p_CB->msg[p_CB->first] = p_msg;
      _incw (&p_CB->count);
      if (++p_CB->first == p_CB->size) {
        p_CB->first = 0;
      }
    }
    else {
      os_error (OS_ERR_MBX_OVF);
    }
  }
}
开发者ID:ChrisXin,项目名称:ECE254-1,代码行数:35,代码来源:rt_Mailbox.c

示例6: vmem_decommit

void vmem_decommit(void *ptr,unsigned long size)
{
    dbg_printf("vmem_decommit(ptr = %p, size = x%lx)\n",ptr,size);
    if (ptr)
    {   if (!VirtualFree(ptr, size, MEM_DECOMMIT))
            os_error();
    }
}
开发者ID:DinrusGroup,项目名称:DRC,代码行数:8,代码来源:os.c

示例7: tell_position

long tell_position (FILE *file) 
{
  long size;
  if ((size = ftell (file)) < 0) {
    os_error();
  }
  return size;
}
开发者ID:simoncozens,项目名称:dvipdfm-x,代码行数:8,代码来源:mfileio.c

示例8: fc_strdup_notrim

char *
fc_strdup_notrim (const char *src, gfc_charlen_type src_len)
{
  char *p = strndup (src, src_len);
  if (!p)
    os_error ("Memory allocation failed in fc_strdup");
  return p;
}
开发者ID:gmarkall,项目名称:gcc,代码行数:8,代码来源:string.c

示例9: auto_codec_open_decoder

void auto_codec_open_decoder(const auto_codec & context, AVCodecID codec_id)
{
    boost::mutex::scoped_lock lock(avcodec_mutex);
    AVCodec * codec = avcodec_find_decoder(codec_id);
    if (!codec)
	throw os_error("avcodec_find_decoder", ENOENT);
    os_check_error("avcodec_open", -avcodec_open2(context.get(), codec, NULL));
}
开发者ID:jdsn,项目名称:dvswitch,代码行数:8,代码来源:auto_codec.cpp

示例10: make_os_error

    static os_error make_os_error(int err, const std::string& text = "")
    {
        std::stringstream msg;
        msg << "errno: " << err;
        if (!text.empty())
            msg << " - " << text;

        return os_error(err, msg.str());
    }
开发者ID:BrendanLeber,项目名称:mdups,代码行数:9,代码来源:mdups.cpp

示例11: os_freelibrary

void os_freelibrary()
{
    if (hdll)
    {
        if (FreeLibrary(hdll) != TRUE)
            os_error();
        hdll = NULL;
    }
}
开发者ID:DinrusGroup,项目名称:DRC,代码行数:9,代码来源:os.c

示例12: vmem_release

void vmem_release(void *ptr,unsigned long size)
{
    dbg_printf("vmem_release(ptr = %p, size = x%lx)\n",ptr,size);
    if (ptr)
    {
        if (!VirtualFree(ptr, 0, MEM_RELEASE))
            os_error();
    }
}
开发者ID:DinrusGroup,项目名称:DRC,代码行数:9,代码来源:os.c

示例13: assert

void *os_getprocaddress(const char *funcname)
{   void *fp;

    //printf("getprocaddress('%s')\n",funcname);
    assert(hdll);
    fp = (void *)GetProcAddress(hdll,(LPCSTR)funcname);
    if (!fp)
        os_error();
    return fp;
}
开发者ID:DinrusGroup,项目名称:DRC,代码行数:10,代码来源:os.c

示例14: os_term

void os_term()
{
    if (hHeap)
    {   if (HeapDestroy(hHeap) == FALSE)
        {   hHeap = NULL;
            os_error();
        }
        hHeap = NULL;
    }
    os_freelibrary();
}
开发者ID:DinrusGroup,项目名称:DRC,代码行数:11,代码来源:os.c

示例15: rt_stk_check

/*--------------------------- rt_stk_check ----------------------------------*/
__weak void rt_stk_check (void) {
    /* Check for stack overflow. */
    if (os_tsk.run->task_id == 0x01) {
        // TODO: For the main thread the check should be done against the main heap pointer
    } else {
        if ((os_tsk.run->tsk_stack < (U32)os_tsk.run->stack) ||
            (os_tsk.run->stack[0] != MAGIC_WORD)) {
            os_error (OS_ERR_STK_OVF);
        }
    }
}
开发者ID:Babody,项目名称:mbed,代码行数:12,代码来源:rt_System.c


注:本文中的os_error函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。