Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #402378

Re: [c+ai] one night with image codec

From David Brown <david.brown@hesbynett.no>
Newsgroups comp.lang.c
Subject Re: [c+ai] one night with image codec
Date 2026-09-25 10:38 +0200
Organization A noiseless patient Spider
Message-ID <1195bti$3bbk8$1@dont-email.me> (permalink)
References <119391l$2ng62$1@dont-email.me> <1193c6q$2on2p$1@dont-email.me> <1193j1g$2rfv9$1@dont-email.me>

Show all headers | View raw


On 24/09/2026 18:27, fir wrote:
> bart pisze:
>> On 24/09/2026 14:36, fir wrote:
>>> i once was writing on this -
>>
>>> #define _WIN32_WINNT 0x0501
>>> #define WIN32_LEAN_AND_MEAN
>>> #define WIN32_EXTRA_LEAN
>>> #include <windows.h>
>>> #include <Mmsystem.h>
>>> #include<math.h>
>>> #include<stdio.h>
>>> #include<stdlib.h>
>>> #include <stdint.h>
>>>
>>> #include "green-fire.h"
>>
>> What's the point of posting a 1200-line program without the headers 
>> and any other dependencies needed to compile it?
>>
>> In any case, you should be posting links to github etc for programs 
>> this big.
>>
>>> int LoadBitmap(const char *filename, Bitmap *b)
>>> {
>>
>> This clashes with LoadBitmap from windows.h (where it is an alias for 
>> LoadBitmapA). It has a different signature.
>>
>> How did you manage to get this to compile? Is there some magic in 
>> green-fire.h that makes it possible?
>>
> 
> i checked if the makero LoadBitmap  is defined it seems so,LoadBitmap 
> from winapi is
> 
> also visible (coz if i comented definitions and only left calls it 
> showed error that arguments non compatible
> 
> so i dont know..i dont kare for such things as i not use macros in my 
> life..it compiles seamlessly
> 

Don't be silly.  C macros are part of C programming, whether you like 
them or not - the first line of your posted code is a macro definition! 
And Bart was talking about a macro defined in <windows.h>, not your code.

> but note i compile is c++ mode (onlu usung it for "const int tab_max")
> 

If you are compiling as C++, then you will have C++ linkage and C++ 
mangled names (unless you have an extern "C" in effect).  C++ supports 
function overloading - there is no problem having two functions with the 
same name but different parameters.  If you don't understand this and 
don't know how it works, and randomly mix C code with C++ (or C compiled 
as C++), you will cause yourself confusion.  Use C, or use C++ - and if 
you want to mix some C and some C++ files, do so in an informed and 
intentional manner.

If all you want here is to be able to write something like :

	const int tab_max = 10;
	int table[tab_max];

then in C you can simply use :

	enum { tab_max = 10 };
	int table[tab_max];

or in C23 :

	constexpr int tab_max = 10;
	int table[tab_max];



Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[c+ai] one night with image codec fir <profesor.fir@gmail.com> - 2026-09-24 15:36 +0200
  Re: [c+ai] one night with image codec fir <profesor.fir@gmail.com> - 2026-09-24 16:06 +0200
    Re: [c+ai] one night with image codec fir <profesor.fir@gmail.com> - 2026-09-24 16:17 +0200
  Re: [c+ai] one night with image codec bart <bc@freeuk.com> - 2026-09-24 15:30 +0100
    Re: [c+ai] one night with image codec fir <profesor.fir@gmail.com> - 2026-09-24 16:45 +0200
      Re: [c+ai] one night with image codec "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-09-24 16:31 -0700
        Re: [c+ai] one night with image codec fir <profesor.fir@gmail.com> - 2026-09-25 02:05 +0200
          Re: [c+ai] one night with image codec "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-09-27 15:05 -0700
            Re: [c+ai] one night with image codec bart <bc@freeuk.com> - 2026-09-28 00:44 +0100
              Re: [c+ai] one night with image codec fir <profesor.fir@gmail.com> - 2026-09-28 04:22 +0200
              Re: [c+ai] one night with image codec Paul <nospam@needed.invalid> - 2026-09-28 04:27 -0400
    Re: [c+ai] one night with image codec fir <profesor.fir@gmail.com> - 2026-09-24 18:27 +0200
      Re: [c+ai] one night with image codec David Brown <david.brown@hesbynett.no> - 2026-09-25 10:38 +0200
        Re: [c+ai] one night with image codec fir <profesor.fir@gmail.com> - 2026-09-25 10:57 +0200
    Re: [c+ai] one night with image codec David Brown <david.brown@hesbynett.no> - 2026-09-25 10:49 +0200
      Re: [c+ai] one night with image codec bart <bc@freeuk.com> - 2026-09-25 10:49 +0100
      Re: [c+ai] one night with image codec Jim Jackson <jj@franjam.org.uk> - 2026-09-25 12:01 +0000
        Re: [c+ai] one night with image codec fir <profesor.fir@gmail.com> - 2026-09-26 02:51 +0200
  Re: [c+ai] one night with image codec Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-10-01 00:08 +0800

csiph-web