ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/myhostname.c
Revision: 2.8
Committed: Sun Mar 6 01:13:17 2016 UTC (8 years, 2 months ago) by schorsch
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad5R1, rad5R3, HEAD
Changes since 2.7: +2 -2 lines
Log Message:
Prepare for SCons build on Win32 and Win64

File Contents

# User Rev Content
1 greg 2.1 #ifndef lint
2 schorsch 2.8 static const char RCSid[] = "$Id: myhostname.c,v 2.7 2003/10/27 10:19:31 schorsch Exp $";
3 greg 2.1 #endif
4     /*
5     * Query system for host name
6 greg 2.2 */
7    
8 greg 2.3 #include "copyright.h"
9 greg 2.1
10 schorsch 2.8 #if defined(_WIN32) || defined(_WIN64)
11 schorsch 2.7 #include <winsock2.h>
12 schorsch 2.6 #else
13     #include <unistd.h>
14     #endif
15 schorsch 2.5
16     #include "rtmisc.h"
17 greg 2.1
18 schorsch 2.7 extern char *
19 greg 2.1 myhostname()
20     {
21     static char hostname[65];
22    
23     if (!hostname[0])
24     gethostname(hostname, sizeof(hostname));
25     return(hostname);
26     }
27