Sponsored Content
Top Forums Programming Can C determine which OS it's being compiled on? Post 302270948 by quattro20v on Tuesday 23rd of December 2008 09:18:44 AM
Old 12-23-2008
Can C determine which OS it's being compiled on?

Hello all! I've searched the archives, google, documentation and I can't seem to find any answer regarding my question.

Our code has to be lint free and due to the following lint warning --->
logical expression always true: op "||" <--- we are forced to #include <note.h > (which appears to be Solaris specific) in order to use "NOTE(CONSTCOND) /*CONSTCOND*/" within the code to suppress the above warning. Any ideas on whether or not standard C can determine an OS? Ideally, I'd like C to determine what OS and from there include the header or not based on OS . . . if SunOS, then include note.h, else do not. I know this is far-fetched Smilie but had to ask. TIA!

Steven


 

10 More Discussions You Might Find Interesting

1. Programming

Running a compiled Program

Just getting into the Unix command line programming and am unable to run any program I write. I am using a Makefile and the source is compiling but when I enter the name of the output file I get back: bash: lab01exe.out: command not found I'm sure I am just dooing something simple... (2 Replies)
Discussion started by: Krebsbac
2 Replies

2. UNIX for Advanced & Expert Users

Compiled Files

I am using SCO Unix with a Progress Database. There are files that 'pop up' and cause problems. I need to be able to read these files but they are compiled and I don't know how to un-compile them. Is there some kind of software / shareware that I can download to view these files? Is... (2 Replies)
Discussion started by: tripp4337
2 Replies

3. UNIX for Dummies Questions & Answers

Compiled Compiler

I've got Solaris9 and it comes with no compiler. I've downloaded gcc from GNU, but you can't compile the files without the compiler (chicken before the egg situation). Some sites point to an ftp site of ftp.ai.prep.mit.edu where a compiled version of the GNU gcc exists, but when I have gone there... (3 Replies)
Discussion started by: AJA
3 Replies

4. Programming

Why my code couldn't be compiled

#include <Xm/Xm.h> #include <Xm/PushB.h> Widget CreatePushbutton(Widget parent, char* name, XtCallbackProc callback, XtPointer client_data) { Widget push; Arg args; Cardinal n; n=0; push=XmCreatePushButton(parent, name, args, n); XtAddCallback(push,... (4 Replies)
Discussion started by: endeavour1985
4 Replies

5. Programming

How to use a .exe with a compiled program.

I am confused about how to use a .exe file in unix along with a compiled C++ program. I've been using emacs and I compiled with g++, but I have no idea how that relates to use with a .exe. (1 Reply)
Discussion started by: adamsy
1 Replies

6. UNIX for Dummies Questions & Answers

compiled software installed correctly?

Greetings all, first time poster. I have always had an interest in Unix and so decided to try and learn some on my own. I have learned a great deal by just lurking, so for those of you who patiently share your knowledge-thank you! I am in the process of compiling and installing some... (3 Replies)
Discussion started by: RobertSubnet
3 Replies

7. UNIX for Advanced & Expert Users

cannot run c compiled programs

iam in the way of making graphics using SDL.i copied from cd usign mount -a /cdrom cd /cdrom cp SDL-1.2.11.tar.gz /usr/test cd /usr/test gunzip SDL-1.2.11.tar.gz tar -xf SDL-1.2.11.tar cd SDL-1.2.11 ./configure ... ... it stops at checking whether the c compiler... (4 Replies)
Discussion started by: kumarangopi
4 Replies

8. UNIX for Advanced & Expert Users

Viewing a compiled executable file

I've got a executable binary file (source code fortran77, compiled using gfortran). I'm not sure this is even possible but I remember someone I knew was able to view the source code that created this binary file, i.e. he used a program that enabled him to see what the source code was. Is this... (2 Replies)
Discussion started by: lost.identity
2 Replies

9. Solaris

Issue in pro*C program compiled in solaris 10

Hi, We upgraded our servers from solaris 9 to 10. We recompiled all the Pro*C programs with the new oracle version as well. Oracle is 11g. We are facing core dump with the below error for certain executions. But when we are placing new statements between the error fucntion we get junk values to... (1 Reply)
Discussion started by: saroopkris85
1 Replies

10. UNIX for Advanced & Expert Users

How to reverse compiled bash (obfucation)?

hi guys, 10 years a go I wrote an script in bash programming and I compiled (obfuscate) it, but after 10 years I need to change some lines and remove some lines, but i do not remember what I've done. does anyone has any idea about decompile (deobfuscation) it? here is some line of my code (u... (3 Replies)
Discussion started by: mhsh0001
3 Replies
load_dat_font(3alleg4)						  Allegro manual					    load_dat_font(3alleg4)

NAME
load_dat_font - Loads a FONT from an Allegro datafile. SYNOPSIS
#include <allegro.h> FONT *load_dat_font(const char *filename, RGB *pal, void *param) DESCRIPTION
Loads a FONT from an Allegro datafile. You can set param parameter to point to an array that holds two strings that identify the font and the palette in the datafile by name. The first string in this list is the name of the font. You can pass NULL here to just load the first font found in the datafile. The second string can be used to specify the name of the palette associated with the font. This is only returned if the pal parameter is not NULL. If you pass NULL for the name of the palette, the last palette found before the font was found is returned. You can also pass NULL for param, which is treated as if you had passed NULL for both strings separately. In this case, the function will simply load the first font it finds from the datafile and the palette that precedes it. For example, suppose you have a datafile named `fonts.dat' with the following contents: FONT FONT_1_DATA FONT FONT_2_DATA FONT FONT_3_DATA PAL FONT_1_PALETTE PAL FONT_2_PALETTE Then the following code will load FONT_1_DATA as a FONT and return FONT_1_PALETTE as the palette: FONT *f; PALETTE pal; char *names[] = { "FONT_1_DATA", "FONT_1_PALETTE" } f = load_dat_font("fonts.dat", pal, names); If instead you want to load the second font, FONT_2, from the datafile, you would use: FONT *f; PALETTE pal; char *names[] = { "FONT_2_DATA", "FONT_2_PALETTE" } f = load_dat_font("fonts.dat", pal, names); If you want to load the third font, but not bother with a palette, use: FONT *f; char *names[] = { "FONT_3_DATA", NULL } f = load_dat_font("fonts.dat", NULL, names); RETURN VALUE
Returns a pointer to the font or NULL on error. Remember that you are responsible for destroying the font when you are finished with it to avoid memory leaks. SEE ALSO
register_font_file_type(3alleg4), load_font(3alleg4) Allegro version 4.4.2 load_dat_font(3alleg4)
All times are GMT -4. The time now is 01:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy