1
0
mirror of https://github.com/alex-sector/dns2tcp.git synced 2025-05-09 10:11:16 +08:00
dns2tcp/common/myrand.c
2017-11-23 15:32:42 +01:00

44 lines
1.1 KiB
C

/*
** Copyright (C) 2006 Olivier DEMBOUR
** $Id: myrand.c,v 1.6 2007/05/29 14:51:14 dembour Exp $
**
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with This program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdlib.h>
#include "config.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef _WIN32
#include "mywin32.h"
#endif
uint16_t myrand()
{
int res;
res = rand();
return ((res >> 4) ^ (res & 0xFFFF));
}