mirror of
https://github.com/reactos/reactos.git
synced 2025-04-21 20:50:29 +00:00

Imported from https://www.nuget.org/packages/Microsoft.Windows.SDK.CRTSource/10.0.22621.3 License: MIT
24 lines
418 B
C++
24 lines
418 B
C++
//
|
|
// abs.cpp
|
|
//
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
//
|
|
// Defines abs() and _abs64(), which compute the absolute value of a number.
|
|
//
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#pragma function(abs, _abs64)
|
|
|
|
|
|
|
|
extern "C" int __cdecl abs(int const number)
|
|
{
|
|
return number >= 0 ? number : -number;
|
|
}
|
|
|
|
extern "C" __int64 __cdecl _abs64(__int64 const number)
|
|
{
|
|
return number >= 0 ? number : -number;
|
|
}
|